[TG3]: Add tagged status support.
[linux-2.6/verdex.git] / drivers / net / wireless / orinoco.h
blob13e42c2afb272bd6a8d9978571248c597bdce69a
1 /* orinoco.h
2 *
3 * Common definitions to all pieces of the various orinoco
4 * drivers
5 */
7 #ifndef _ORINOCO_H
8 #define _ORINOCO_H
10 #define DRIVER_VERSION "0.14alpha2"
12 #include <linux/types.h>
13 #include <linux/spinlock.h>
14 #include <linux/netdevice.h>
15 #include <linux/wireless.h>
16 #include <linux/version.h>
18 #include "hermes.h"
20 /* To enable debug messages */
21 //#define ORINOCO_DEBUG 3
23 #define WIRELESS_SPY // enable iwspy support
25 #define ORINOCO_MAX_KEY_SIZE 14
26 #define ORINOCO_MAX_KEYS 4
28 struct orinoco_key {
29 u16 len; /* always stored as little-endian */
30 char data[ORINOCO_MAX_KEY_SIZE];
31 } __attribute__ ((packed));
33 typedef enum {
34 FIRMWARE_TYPE_AGERE,
35 FIRMWARE_TYPE_INTERSIL,
36 FIRMWARE_TYPE_SYMBOL
37 } fwtype_t;
39 struct orinoco_private {
40 void *card; /* Pointer to card dependent structure */
41 int (*hard_reset)(struct orinoco_private *);
43 /* Synchronisation stuff */
44 spinlock_t lock;
45 int hw_unavailable;
46 struct work_struct reset_work;
48 /* driver state */
49 int open;
50 u16 last_linkstatus;
52 /* Net device stuff */
53 struct net_device *ndev;
54 struct net_device_stats stats;
55 struct iw_statistics wstats;
57 /* Hardware control variables */
58 hermes_t hw;
59 u16 txfid;
61 /* Capabilities of the hardware/firmware */
62 fwtype_t firmware_type;
63 char fw_name[32];
64 int ibss_port;
65 int nicbuf_size;
66 u16 channel_mask;
68 /* Boolean capabilities */
69 unsigned int has_ibss:1;
70 unsigned int has_port3:1;
71 unsigned int has_wep:1;
72 unsigned int has_big_wep:1;
73 unsigned int has_mwo:1;
74 unsigned int has_pm:1;
75 unsigned int has_preamble:1;
76 unsigned int has_sensitivity:1;
77 unsigned int broken_disableport:1;
79 /* Configuration paramaters */
80 u32 iw_mode;
81 int prefer_port3;
82 u16 wep_on, wep_restrict, tx_key;
83 struct orinoco_key keys[ORINOCO_MAX_KEYS];
84 int bitratemode;
85 char nick[IW_ESSID_MAX_SIZE+1];
86 char desired_essid[IW_ESSID_MAX_SIZE+1];
87 u16 frag_thresh, mwo_robust;
88 u16 channel;
89 u16 ap_density, rts_thresh;
90 u16 pm_on, pm_mcast, pm_period, pm_timeout;
91 u16 preamble;
92 #ifdef WIRELESS_SPY
93 int spy_number;
94 u_char spy_address[IW_MAX_SPY][ETH_ALEN];
95 struct iw_quality spy_stat[IW_MAX_SPY];
96 #endif
98 /* Configuration dependent variables */
99 int port_type, createibss;
100 int promiscuous, mc_count;
103 #ifdef ORINOCO_DEBUG
104 extern int orinoco_debug;
105 #define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0)
106 #else
107 #define DEBUG(n, args...) do { } while (0)
108 #endif /* ORINOCO_DEBUG */
110 #define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__);
111 #define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__);
113 /********************************************************************/
114 /* Exported prototypes */
115 /********************************************************************/
117 extern struct net_device *alloc_orinocodev(int sizeof_card,
118 int (*hard_reset)(struct orinoco_private *));
119 extern void free_orinocodev(struct net_device *dev);
120 extern int __orinoco_up(struct net_device *dev);
121 extern int __orinoco_down(struct net_device *dev);
122 extern int orinoco_stop(struct net_device *dev);
123 extern int orinoco_reinit_firmware(struct net_device *dev);
124 extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
126 /********************************************************************/
127 /* Locking and synchronization functions */
128 /********************************************************************/
130 /* These functions *must* be inline or they will break horribly on
131 * SPARC, due to its weird semantics for save/restore flags. extern
132 * inline should prevent the kernel from linking or module from
133 * loading if they are not inlined. */
134 extern inline int orinoco_lock(struct orinoco_private *priv,
135 unsigned long *flags)
137 spin_lock_irqsave(&priv->lock, *flags);
138 if (priv->hw_unavailable) {
139 DEBUG(1, "orinoco_lock() called with hw_unavailable (dev=%p)\n",
140 priv->ndev);
141 spin_unlock_irqrestore(&priv->lock, *flags);
142 return -EBUSY;
144 return 0;
147 extern inline void orinoco_unlock(struct orinoco_private *priv,
148 unsigned long *flags)
150 spin_unlock_irqrestore(&priv->lock, *flags);
153 #endif /* _ORINOCO_H */