3 * Common definitions to all pieces of the various orinoco
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>
20 /* To enable debug messages */
21 //#define ORINOCO_DEBUG 3
23 #define WIRELESS_SPY // enable iwspy support
25 #define MAX_SCAN_LEN 4096
27 #define ORINOCO_MAX_KEY_SIZE 14
28 #define ORINOCO_MAX_KEYS 4
31 u16 len; /* always stored as little-endian */
32 char data[ORINOCO_MAX_KEY_SIZE];
33 } __attribute__ ((packed));
37 FIRMWARE_TYPE_INTERSIL,
41 struct orinoco_private {
42 void *card; /* Pointer to card dependent structure */
43 int (*hard_reset)(struct orinoco_private *);
45 /* Synchronisation stuff */
48 struct work_struct reset_work;
53 struct work_struct join_work;
55 /* Net device stuff */
56 struct net_device *ndev;
57 struct net_device_stats stats;
58 struct iw_statistics wstats;
60 /* Hardware control variables */
64 /* Capabilities of the hardware/firmware */
65 fwtype_t firmware_type;
71 /* Boolean capabilities */
72 unsigned int has_ibss:1;
73 unsigned int has_port3:1;
74 unsigned int has_wep:1;
75 unsigned int has_big_wep:1;
76 unsigned int has_mwo:1;
77 unsigned int has_pm:1;
78 unsigned int has_preamble:1;
79 unsigned int has_sensitivity:1;
80 unsigned int broken_disableport:1;
82 /* Configuration paramaters */
85 u16 wep_on, wep_restrict, tx_key;
86 struct orinoco_key keys[ORINOCO_MAX_KEYS];
88 char nick[IW_ESSID_MAX_SIZE+1];
89 char desired_essid[IW_ESSID_MAX_SIZE+1];
90 char desired_bssid[ETH_ALEN];
92 u16 frag_thresh, mwo_robust;
94 u16 ap_density, rts_thresh;
95 u16 pm_on, pm_mcast, pm_period, pm_timeout;
99 u_char spy_address[IW_MAX_SPY][ETH_ALEN];
100 struct iw_quality spy_stat[IW_MAX_SPY];
103 /* Configuration dependent variables */
104 int port_type, createibss;
105 int promiscuous, mc_count;
109 extern int orinoco_debug;
110 #define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0)
112 #define DEBUG(n, args...) do { } while (0)
113 #endif /* ORINOCO_DEBUG */
115 #define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__);
116 #define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__);
118 /********************************************************************/
119 /* Exported prototypes */
120 /********************************************************************/
122 extern struct net_device *alloc_orinocodev(int sizeof_card,
123 int (*hard_reset)(struct orinoco_private *));
124 extern void free_orinocodev(struct net_device *dev);
125 extern int __orinoco_up(struct net_device *dev);
126 extern int __orinoco_down(struct net_device *dev);
127 extern int orinoco_reinit_firmware(struct net_device *dev);
128 extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
130 /********************************************************************/
131 /* Locking and synchronization functions */
132 /********************************************************************/
134 /* These functions *must* be inline or they will break horribly on
135 * SPARC, due to its weird semantics for save/restore flags. extern
136 * inline should prevent the kernel from linking or module from
137 * loading if they are not inlined. */
138 extern inline int orinoco_lock(struct orinoco_private *priv,
139 unsigned long *flags)
141 spin_lock_irqsave(&priv->lock, *flags);
142 if (priv->hw_unavailable) {
143 DEBUG(1, "orinoco_lock() called with hw_unavailable (dev=%p)\n",
145 spin_unlock_irqrestore(&priv->lock, *flags);
151 extern inline void orinoco_unlock(struct orinoco_private *priv,
152 unsigned long *flags)
154 spin_unlock_irqrestore(&priv->lock, *flags);
157 #endif /* _ORINOCO_H */