orinoco: more reliable scan handling
[safe/jmp/linux-2.6] / drivers / net / wireless / orinoco.h
index 2a6b1c0..c6b1858 100644 (file)
@@ -7,13 +7,11 @@
 #ifndef _ORINOCO_H
 #define _ORINOCO_H
 
-#define DRIVER_VERSION "0.14alpha2"
+#define DRIVER_VERSION "0.15"
 
-#include <linux/types.h>
-#include <linux/spinlock.h>
 #include <linux/netdevice.h>
 #include <linux/wireless.h>
-#include <linux/version.h>
+#include <net/iw_handler.h>
 
 #include "hermes.h"
 
 #define ORINOCO_MAX_KEYS       4
 
 struct orinoco_key {
-       u16 len;        /* always stored as little-endian */
+       __le16 len;     /* always stored as little-endian */
        char data[ORINOCO_MAX_KEY_SIZE];
 } __attribute__ ((packed));
 
-struct header_struct {
-       /* 802.3 */
-       u8 dest[ETH_ALEN];
-       u8 src[ETH_ALEN];
-       u16 len;
-       /* 802.2 */
-       u8 dsap;
-       u8 ssap;
-       u8 ctrl;
-       /* SNAP */
-       u8 oui[3];
-       u16 ethertype;
-} __attribute__ ((packed));
-
 typedef enum {
        FIRMWARE_TYPE_AGERE,
        FIRMWARE_TYPE_INTERSIL,
        FIRMWARE_TYPE_SYMBOL
 } fwtype_t;
 
+typedef struct {
+       union hermes_scan_info bss;
+       unsigned long last_scanned;
+       struct list_head list;
+} bss_element;
+
 struct orinoco_private {
        void *card;     /* Pointer to card dependent structure */
        int (*hard_reset)(struct orinoco_private *);
@@ -94,6 +84,7 @@ struct orinoco_private {
        unsigned int has_sensitivity:1;
        unsigned int has_hostscan:1;
        unsigned int broken_disableport:1;
+       unsigned int broken_monitor:1;
 
        /* Configuration paramaters */
        u32 iw_mode;
@@ -111,9 +102,8 @@ struct orinoco_private {
        u16 pm_on, pm_mcast, pm_period, pm_timeout;
        u16 preamble;
 #ifdef WIRELESS_SPY
-       int                     spy_number;
-       u_char                  spy_address[IW_MAX_SPY][ETH_ALEN];
-       struct iw_quality       spy_stat[IW_MAX_SPY];
+       struct iw_spy_data spy_data; /* iwspy support */
+       struct iw_public_data   wireless_data;
 #endif
 
        /* Configuration dependent variables */
@@ -121,10 +111,12 @@ struct orinoco_private {
        int promiscuous, mc_count;
 
        /* Scanning support */
+       struct list_head bss_list;
+       struct list_head bss_free_list;
+       bss_element *bss_data;
+
        int     scan_inprogress;        /* Scan pending... */
        u32     scan_mode;              /* Type of scan done */
-       char *  scan_result;            /* Result of previous scan */
-       int     scan_len;               /* Lenght of result */
 };
 
 #ifdef ORINOCO_DEBUG
@@ -134,9 +126,6 @@ extern int orinoco_debug;
 #define DEBUG(n, args...) do { } while (0)
 #endif /* ORINOCO_DEBUG */
 
-#define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__);
-#define TRACE_EXIT(devname)  DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__);
-
 /********************************************************************/
 /* Exported prototypes                                              */
 /********************************************************************/
@@ -147,17 +136,13 @@ extern void free_orinocodev(struct net_device *dev);
 extern int __orinoco_up(struct net_device *dev);
 extern int __orinoco_down(struct net_device *dev);
 extern int orinoco_reinit_firmware(struct net_device *dev);
-extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
+extern irqreturn_t orinoco_interrupt(int irq, void * dev_id);
 
 /********************************************************************/
 /* Locking and synchronization functions                            */
 /********************************************************************/
 
-/* These functions *must* be inline or they will break horribly on
- * SPARC, due to its weird semantics for save/restore flags. extern
- * inline should prevent the kernel from linking or module from
- * loading if they are not inlined. */
-extern inline int orinoco_lock(struct orinoco_private *priv,
+static inline int orinoco_lock(struct orinoco_private *priv,
                               unsigned long *flags)
 {
        spin_lock_irqsave(&priv->lock, *flags);
@@ -170,7 +155,7 @@ extern inline int orinoco_lock(struct orinoco_private *priv,
        return 0;
 }
 
-extern inline void orinoco_unlock(struct orinoco_private *priv,
+static inline void orinoco_unlock(struct orinoco_private *priv,
                                  unsigned long *flags)
 {
        spin_unlock_irqrestore(&priv->lock, *flags);