3 * Common definitions to all pieces of the various orinoco
10 #define DRIVER_VERSION "0.13e"
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 ORINOCO_MAX_KEY_SIZE 14
26 #define ORINOCO_MAX_KEYS 4
29 u16 len; /* always stored as little-endian */
30 char data[ORINOCO_MAX_KEY_SIZE];
31 } __attribute__ ((packed));
33 struct orinoco_private {
34 void *card; /* Pointer to card dependent structure */
35 int (*hard_reset)(struct orinoco_private *);
37 /* Synchronisation stuff */
40 struct work_struct reset_work;
47 /* Net device stuff */
48 struct net_device *ndev;
49 struct net_device_stats stats;
50 struct iw_statistics wstats;
52 /* Hardware control variables */
56 /* Capabilities of the hardware/firmware */
58 #define FIRMWARE_TYPE_AGERE 1
59 #define FIRMWARE_TYPE_INTERSIL 2
60 #define FIRMWARE_TYPE_SYMBOL 3
61 int has_ibss, has_port3, has_ibss_any, ibss_port;
62 int has_wep, has_big_wep;
69 int broken_disableport;
71 /* Configuration paramaters */
74 u16 wep_on, wep_restrict, tx_key;
75 struct orinoco_key keys[ORINOCO_MAX_KEYS];
77 char nick[IW_ESSID_MAX_SIZE+1];
78 char desired_essid[IW_ESSID_MAX_SIZE+1];
79 u16 frag_thresh, mwo_robust;
81 u16 ap_density, rts_thresh;
82 u16 pm_on, pm_mcast, pm_period, pm_timeout;
86 u_char spy_address[IW_MAX_SPY][ETH_ALEN];
87 struct iw_quality spy_stat[IW_MAX_SPY];
90 /* Configuration dependent variables */
91 int port_type, createibss;
92 int promiscuous, mc_count;
96 extern int orinoco_debug;
97 #define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0)
99 #define DEBUG(n, args...) do { } while (0)
100 #endif /* ORINOCO_DEBUG */
102 #define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__);
103 #define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__);
105 /********************************************************************/
106 /* Exported prototypes */
107 /********************************************************************/
109 extern struct net_device *alloc_orinocodev(int sizeof_card,
110 int (*hard_reset)(struct orinoco_private *));
111 extern int __orinoco_up(struct net_device *dev);
112 extern int __orinoco_down(struct net_device *dev);
113 extern int orinoco_stop(struct net_device *dev);
114 extern int orinoco_reinit_firmware(struct net_device *dev);
115 extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
117 /********************************************************************/
118 /* Locking and synchronization functions */
119 /********************************************************************/
121 /* These functions *must* be inline or they will break horribly on
122 * SPARC, due to its weird semantics for save/restore flags. extern
123 * inline should prevent the kernel from linking or module from
124 * loading if they are not inlined. */
125 extern inline int orinoco_lock(struct orinoco_private *priv,
126 unsigned long *flags)
128 spin_lock_irqsave(&priv->lock, *flags);
129 if (priv->hw_unavailable) {
130 printk(KERN_DEBUG "orinoco_lock() called with hw_unavailable (dev=%p)\n",
132 spin_unlock_irqrestore(&priv->lock, *flags);
138 extern inline void orinoco_unlock(struct orinoco_private *priv,
139 unsigned long *flags)
141 spin_unlock_irqrestore(&priv->lock, *flags);
144 #endif /* _ORINOCO_H */