3  * Common definitions to all pieces of the various orinoco
 
  10 #define DRIVER_VERSION "0.15"
 
  12 #include <linux/netdevice.h>
 
  13 #include <linux/wireless.h>
 
  14 #include <net/iw_handler.h>
 
  18 /* To enable debug messages */
 
  19 //#define ORINOCO_DEBUG         3
 
  21 #define WIRELESS_SPY            // enable iwspy support
 
  23 #define MAX_SCAN_LEN            4096
 
  25 #define ORINOCO_MAX_KEY_SIZE    14
 
  26 #define ORINOCO_MAX_KEYS        4
 
  29         __le16 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;
 
  51         struct work_struct join_work;
 
  52         struct work_struct wevent_work;
 
  54         /* Net device stuff */
 
  55         struct net_device *ndev;
 
  56         struct net_device_stats stats;
 
  57         struct iw_statistics wstats;
 
  59         /* Hardware control variables */
 
  63         /* Capabilities of the hardware/firmware */
 
  64         fwtype_t firmware_type;
 
  70         /* Boolean capabilities */
 
  71         unsigned int has_ibss:1;
 
  72         unsigned int has_port3:1;
 
  73         unsigned int has_wep:1;
 
  74         unsigned int has_big_wep:1;
 
  75         unsigned int has_mwo:1;
 
  76         unsigned int has_pm:1;
 
  77         unsigned int has_preamble:1;
 
  78         unsigned int has_sensitivity:1;
 
  79         unsigned int has_hostscan:1;
 
  80         unsigned int broken_disableport:1;
 
  81         unsigned int broken_monitor:1;
 
  83         /* Configuration paramaters */
 
  86         u16 wep_on, wep_restrict, tx_key;
 
  87         struct orinoco_key keys[ORINOCO_MAX_KEYS];
 
  89         char nick[IW_ESSID_MAX_SIZE+1];
 
  90         char desired_essid[IW_ESSID_MAX_SIZE+1];
 
  91         char desired_bssid[ETH_ALEN];
 
  93         u16 frag_thresh, mwo_robust;
 
  95         u16 ap_density, rts_thresh;
 
  96         u16 pm_on, pm_mcast, pm_period, pm_timeout;
 
  99         struct iw_spy_data spy_data; /* iwspy support */
 
 100         struct iw_public_data   wireless_data;
 
 103         /* Configuration dependent variables */
 
 104         int port_type, createibss;
 
 105         int promiscuous, mc_count;
 
 107         /* Scanning support */
 
 108         int     scan_inprogress;        /* Scan pending... */
 
 109         u32     scan_mode;              /* Type of scan done */
 
 110         char *  scan_result;            /* Result of previous scan */
 
 111         int     scan_len;               /* Lenght of result */
 
 115 extern int orinoco_debug;
 
 116 #define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0)
 
 118 #define DEBUG(n, args...) do { } while (0)
 
 119 #endif  /* ORINOCO_DEBUG */
 
 121 /********************************************************************/
 
 122 /* Exported prototypes                                              */
 
 123 /********************************************************************/
 
 125 extern struct net_device *alloc_orinocodev(int sizeof_card,
 
 126                                            int (*hard_reset)(struct orinoco_private *));
 
 127 extern void free_orinocodev(struct net_device *dev);
 
 128 extern int __orinoco_up(struct net_device *dev);
 
 129 extern int __orinoco_down(struct net_device *dev);
 
 130 extern int orinoco_reinit_firmware(struct net_device *dev);
 
 131 extern irqreturn_t orinoco_interrupt(int irq, void * dev_id);
 
 133 /********************************************************************/
 
 134 /* Locking and synchronization functions                            */
 
 135 /********************************************************************/
 
 137 static inline int orinoco_lock(struct orinoco_private *priv,
 
 138                                unsigned long *flags)
 
 140         spin_lock_irqsave(&priv->lock, *flags);
 
 141         if (priv->hw_unavailable) {
 
 142                 DEBUG(1, "orinoco_lock() called with hw_unavailable (dev=%p)\n",
 
 144                 spin_unlock_irqrestore(&priv->lock, *flags);
 
 150 static inline void orinoco_unlock(struct orinoco_private *priv,
 
 151                                   unsigned long *flags)
 
 153         spin_unlock_irqrestore(&priv->lock, *flags);
 
 156 #endif /* _ORINOCO_H */