]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
1da177e4 LT |
2 | * Copyright (C) 2002 Intersil Americas Inc. |
3 | * Copyright (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu> | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation; either version 2 of the License | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program; if not, write to the Free Software | |
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 | * | |
18 | */ | |
19 | ||
20 | #ifndef _ISLPCI_MGT_H | |
21 | #define _ISLPCI_MGT_H | |
22 | ||
23 | #include <linux/wireless.h> | |
24 | #include <linux/skbuff.h> | |
5a0e3ad6 | 25 | #include <linux/slab.h> |
1da177e4 LT |
26 | |
27 | /* | |
28 | * Function definitions | |
29 | */ | |
30 | ||
31 | #define K_DEBUG(f, m, args...) do { if(f & m) printk(KERN_DEBUG args); } while(0) | |
32 | #define DEBUG(f, args...) K_DEBUG(f, pc_debug, args) | |
33 | ||
34 | extern int pc_debug; | |
35 | #define init_wds 0 /* help compiler optimize away dead code */ | |
36 | ||
37 | ||
38 | /* General driver definitions */ | |
93b2dd12 DT |
39 | #define PCIDEVICE_LATENCY_TIMER_MIN 0x40 |
40 | #define PCIDEVICE_LATENCY_TIMER_VAL 0x50 | |
1da177e4 LT |
41 | |
42 | /* Debugging verbose definitions */ | |
43 | #define SHOW_NOTHING 0x00 /* overrules everything */ | |
44 | #define SHOW_ANYTHING 0xFF | |
45 | #define SHOW_ERROR_MESSAGES 0x01 | |
46 | #define SHOW_TRAPS 0x02 | |
47 | #define SHOW_FUNCTION_CALLS 0x04 | |
48 | #define SHOW_TRACING 0x08 | |
49 | #define SHOW_QUEUE_INDEXES 0x10 | |
50 | #define SHOW_PIMFOR_FRAMES 0x20 | |
51 | #define SHOW_BUFFER_CONTENTS 0x40 | |
52 | #define VERBOSE 0x01 | |
53 | ||
54 | /* Default card definitions */ | |
55 | #define CARD_DEFAULT_CHANNEL 6 | |
56 | #define CARD_DEFAULT_MODE INL_MODE_CLIENT | |
57 | #define CARD_DEFAULT_IW_MODE IW_MODE_INFRA | |
58 | #define CARD_DEFAULT_BSSTYPE DOT11_BSSTYPE_INFRA | |
59 | #define CARD_DEFAULT_CLIENT_SSID "" | |
60 | #define CARD_DEFAULT_AP_SSID "default" | |
61 | #define CARD_DEFAULT_KEY1 "default_key_1" | |
62 | #define CARD_DEFAULT_KEY2 "default_key_2" | |
63 | #define CARD_DEFAULT_KEY3 "default_key_3" | |
64 | #define CARD_DEFAULT_KEY4 "default_key_4" | |
65 | #define CARD_DEFAULT_WEP 0 | |
66 | #define CARD_DEFAULT_FILTER 0 | |
67 | #define CARD_DEFAULT_WDS 0 | |
68 | #define CARD_DEFAULT_AUTHEN DOT11_AUTH_OS | |
69 | #define CARD_DEFAULT_DOT1X 0 | |
70 | #define CARD_DEFAULT_MLME_MODE DOT11_MLME_AUTO | |
71 | #define CARD_DEFAULT_CONFORMANCE OID_INL_CONFORMANCE_NONE | |
72 | #define CARD_DEFAULT_PROFILE DOT11_PROFILE_MIXED_G_WIFI | |
73 | #define CARD_DEFAULT_MAXFRAMEBURST DOT11_MAXFRAMEBURST_MIXED_SAFE | |
74 | ||
75 | /* PIMFOR package definitions */ | |
76 | #define PIMFOR_ETHERTYPE 0x8828 | |
77 | #define PIMFOR_HEADER_SIZE 12 | |
78 | #define PIMFOR_VERSION 1 | |
79 | #define PIMFOR_OP_GET 0 | |
80 | #define PIMFOR_OP_SET 1 | |
81 | #define PIMFOR_OP_RESPONSE 2 | |
82 | #define PIMFOR_OP_ERROR 3 | |
83 | #define PIMFOR_OP_TRAP 4 | |
84 | #define PIMFOR_OP_RESERVED 5 /* till 255 */ | |
85 | #define PIMFOR_DEV_ID_MHLI_MIB 0 | |
86 | #define PIMFOR_FLAG_APPLIC_ORIGIN 0x01 | |
87 | #define PIMFOR_FLAG_LITTLE_ENDIAN 0x02 | |
88 | ||
1da177e4 LT |
89 | void display_buffer(char *, int); |
90 | ||
91 | /* | |
92 | * Type definition section | |
93 | * | |
94 | * the structure defines only the header allowing copyless | |
95 | * frame handling | |
96 | */ | |
97 | typedef struct { | |
98 | u8 version; | |
99 | u8 operation; | |
100 | u32 oid; | |
101 | u8 device_id; | |
102 | u8 flags; | |
103 | u32 length; | |
104 | } __attribute__ ((packed)) | |
105 | pimfor_header_t; | |
106 | ||
107 | /* A received and interrupt-processed management frame, either for | |
108 | * schedule_work(prism54_process_trap) or for priv->mgmt_received, | |
109 | * processed by islpci_mgt_transaction(). */ | |
110 | struct islpci_mgmtframe { | |
111 | struct net_device *ndev; /* pointer to network device */ | |
112 | pimfor_header_t *header; /* payload header, points into buf */ | |
113 | void *data; /* payload ex header, points into buf */ | |
114 | struct work_struct ws; /* argument for schedule_work() */ | |
115 | char buf[0]; /* fragment buffer */ | |
116 | }; | |
117 | ||
118 | int | |
119 | islpci_mgt_receive(struct net_device *ndev); | |
120 | ||
121 | int | |
122 | islpci_mgmt_rx_fill(struct net_device *ndev); | |
123 | ||
124 | void | |
125 | islpci_mgt_cleanup_transmit(struct net_device *ndev); | |
126 | ||
127 | int | |
128 | islpci_mgt_transaction(struct net_device *ndev, | |
129 | int operation, unsigned long oid, | |
130 | void *senddata, int sendlen, | |
131 | struct islpci_mgmtframe **recvframe); | |
132 | ||
133 | static inline void | |
134 | islpci_mgt_release(struct islpci_mgmtframe *frame) | |
135 | { | |
136 | kfree(frame); | |
137 | } | |
138 | ||
139 | #endif /* _ISLPCI_MGT_H */ |