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 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
));
35 FIRMWARE_TYPE_INTERSIL
,
39 struct orinoco_private
{
40 void *card
; /* Pointer to card dependent structure */
41 int (*hard_reset
)(struct orinoco_private
*);
43 /* Synchronisation stuff */
46 struct work_struct reset_work
;
52 /* Net device stuff */
53 struct net_device
*ndev
;
54 struct net_device_stats stats
;
55 struct iw_statistics wstats
;
57 /* Hardware control variables */
61 /* Capabilities of the hardware/firmware */
62 fwtype_t firmware_type
;
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 */
82 u16 wep_on
, wep_restrict
, tx_key
;
83 struct orinoco_key keys
[ORINOCO_MAX_KEYS
];
85 char nick
[IW_ESSID_MAX_SIZE
+1];
86 char desired_essid
[IW_ESSID_MAX_SIZE
+1];
87 u16 frag_thresh
, mwo_robust
;
89 u16 ap_density
, rts_thresh
;
90 u16 pm_on
, pm_mcast
, pm_period
, pm_timeout
;
94 u_char spy_address
[IW_MAX_SPY
][ETH_ALEN
];
95 struct iw_quality spy_stat
[IW_MAX_SPY
];
98 /* Configuration dependent variables */
99 int port_type
, createibss
;
100 int promiscuous
, mc_count
;
104 extern int orinoco_debug
;
105 #define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0)
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",
141 spin_unlock_irqrestore(&priv
->lock
, *flags
);
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 */