diff options
author | Paul Mackerras <paulus@samba.org> | 2008-01-31 11:25:51 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-31 11:25:51 +1100 |
commit | bd45ac0c5daae35e7c71138172e63df5cf644cf6 (patch) | |
tree | 5eb5a599bf6a9d7a8a34e802db932aa9e9555de4 /drivers/net/wireless/prism54 | |
parent | 4eece4ccf997c0e6d8fdad3d842e37b16b8d705f (diff) | |
parent | 5bdeae46be6dfe9efa44a548bd622af325f4bdb4 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/net/wireless/prism54')
-rw-r--r-- | drivers/net/wireless/prism54/isl_38xx.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/isl_ioctl.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_dev.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_dev.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_eth.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_eth.h | 38 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_mgt.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_mgt.h | 2 |
8 files changed, 37 insertions, 40 deletions
diff --git a/drivers/net/wireless/prism54/isl_38xx.h b/drivers/net/wireless/prism54/isl_38xx.h index 3fadcb6f529..19c33d31373 100644 --- a/drivers/net/wireless/prism54/isl_38xx.h +++ b/drivers/net/wireless/prism54/isl_38xx.h @@ -138,14 +138,14 @@ isl38xx_w32_flush(void __iomem *base, u32 val, unsigned long offset) #define MAX_FRAGMENT_SIZE_RX 1600 typedef struct { - u32 address; /* physical address on host */ - u16 size; /* packet size */ - u16 flags; /* set of bit-wise flags */ + __le32 address; /* physical address on host */ + __le16 size; /* packet size */ + __le16 flags; /* set of bit-wise flags */ } isl38xx_fragment; struct isl38xx_cb { - u32 driver_curr_frag[ISL38XX_CB_QCOUNT]; - u32 device_curr_frag[ISL38XX_CB_QCOUNT]; + __le32 driver_curr_frag[ISL38XX_CB_QCOUNT]; + __le32 device_curr_frag[ISL38XX_CB_QCOUNT]; isl38xx_fragment rx_data_low[ISL38XX_CB_RX_QSIZE]; isl38xx_fragment tx_data_low[ISL38XX_CB_TX_QSIZE]; isl38xx_fragment rx_data_high[ISL38XX_CB_RX_QSIZE]; diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 6d80ca421cf..1b595a6525f 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c @@ -165,8 +165,7 @@ prism54_update_stats(struct work_struct *work) struct obj_bss bss, *bss2; union oid_res_t r; - if (down_interruptible(&priv->stats_sem)) - return; + down(&priv->stats_sem); /* Noise floor. * I'm not sure if the unit is dBm. @@ -1118,7 +1117,7 @@ prism54_set_encode(struct net_device *ndev, struct iw_request_info *info, mgt_set_request(priv, DOT11_OID_DEFKEYID, 0, &index); } else { - if (!dwrq->flags & IW_ENCODE_MODE) { + if (!(dwrq->flags & IW_ENCODE_MODE)) { /* we cannot do anything. Complain. */ return -EINVAL; } @@ -1793,8 +1792,7 @@ prism54_clear_mac(struct islpci_acl *acl) struct list_head *ptr, *next; struct mac_entry *entry; - if (down_interruptible(&acl->sem)) - return; + down(&acl->sem); if (acl->size == 0) { up(&acl->sem); @@ -2116,8 +2114,7 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid, if (wpa_ie_len > MAX_WPA_IE_LEN) wpa_ie_len = MAX_WPA_IE_LEN; - if (down_interruptible(&priv->wpa_sem)) - return; + down(&priv->wpa_sem); /* try to use existing entry */ list_for_each(ptr, &priv->bss_wpa_list) { @@ -2178,8 +2175,7 @@ prism54_wpa_bss_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie) struct islpci_bss_wpa_ie *bss = NULL; size_t len = 0; - if (down_interruptible(&priv->wpa_sem)) - return 0; + down(&priv->wpa_sem); list_for_each(ptr, &priv->bss_wpa_list) { bss = list_entry(ptr, struct islpci_bss_wpa_ie, list); @@ -2610,7 +2606,7 @@ prism2_ioctl_set_encryption(struct net_device *dev, mgt_set_request(priv, DOT11_OID_DEFKEYID, 0, &index); } else { - if (!param->u.crypt.flags & IW_ENCODE_MODE) { + if (!(param->u.crypt.flags & IW_ENCODE_MODE)) { /* we cannot do anything. Complain. */ return -EINVAL; } diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c index 219dd651dc4..dbb538ccb4e 100644 --- a/drivers/net/wireless/prism54/islpci_dev.c +++ b/drivers/net/wireless/prism54/islpci_dev.c @@ -861,7 +861,7 @@ islpci_setup(struct pci_dev *pdev) init_waitqueue_head(&priv->reset_done); /* init the queue read locks, process wait counter */ - sema_init(&priv->mgmt_sem, 1); + mutex_init(&priv->mgmt_lock); priv->mgmt_received = NULL; init_waitqueue_head(&priv->mgmt_wqueue); sema_init(&priv->stats_sem, 1); diff --git a/drivers/net/wireless/prism54/islpci_dev.h b/drivers/net/wireless/prism54/islpci_dev.h index 736666da6c2..4e0182ce835 100644 --- a/drivers/net/wireless/prism54/islpci_dev.h +++ b/drivers/net/wireless/prism54/islpci_dev.h @@ -26,6 +26,7 @@ #include <linux/wireless.h> #include <net/iw_handler.h> #include <linux/list.h> +#include <linux/mutex.h> #include "isl_38xx.h" #include "isl_oid.h" @@ -164,7 +165,7 @@ typedef struct { wait_queue_head_t reset_done; /* used by islpci_mgt_transaction */ - struct semaphore mgmt_sem; /* serialize access to mailbox and wqueue */ + struct mutex mgmt_lock; /* serialize access to mailbox and wqueue */ struct islpci_mgmtframe *mgmt_received; /* mbox for incoming frame */ wait_queue_head_t mgmt_wqueue; /* waitqueue for mbox */ diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index f49eb068c7d..762e85bef55 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c @@ -471,7 +471,7 @@ islpci_eth_receive(islpci_private *priv) wmb(); /* increment the driver read pointer */ - add_le32p((u32 *) &control_block-> + add_le32p(&control_block-> driver_curr_frag[ISL38XX_CB_RX_DATA_LQ], 1); } diff --git a/drivers/net/wireless/prism54/islpci_eth.h b/drivers/net/wireless/prism54/islpci_eth.h index 5bf820defbd..61454d32d74 100644 --- a/drivers/net/wireless/prism54/islpci_eth.h +++ b/drivers/net/wireless/prism54/islpci_eth.h @@ -23,15 +23,15 @@ #include "islpci_dev.h" struct rfmon_header { - u16 unk0; /* = 0x0000 */ - u16 length; /* = 0x1400 */ - u32 clock; /* 1MHz clock */ + __le16 unk0; /* = 0x0000 */ + __le16 length; /* = 0x1400 */ + __le32 clock; /* 1MHz clock */ u8 flags; u8 unk1; u8 rate; u8 unk2; - u16 freq; - u16 unk3; + __le16 freq; + __le16 unk3; u8 rssi; u8 padding[3]; } __attribute__ ((packed)); @@ -47,20 +47,20 @@ struct rx_annex_header { #define P80211CAPTURE_VERSION 0x80211001 struct avs_80211_1_header { - uint32_t version; - uint32_t length; - uint64_t mactime; - uint64_t hosttime; - uint32_t phytype; - uint32_t channel; - uint32_t datarate; - uint32_t antenna; - uint32_t priority; - uint32_t ssi_type; - int32_t ssi_signal; - int32_t ssi_noise; - uint32_t preamble; - uint32_t encoding; + __be32 version; + __be32 length; + __be64 mactime; + __be64 hosttime; + __be32 phytype; + __be32 channel; + __be32 datarate; + __be32 antenna; + __be32 priority; + __be32 ssi_type; + __be32 ssi_signal; + __be32 ssi_noise; + __be32 preamble; + __be32 encoding; }; void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *); diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c index 2246f7930b4..f7c677e2094 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.c +++ b/drivers/net/wireless/prism54/islpci_mgt.c @@ -460,7 +460,7 @@ islpci_mgt_transaction(struct net_device *ndev, *recvframe = NULL; - if (down_interruptible(&priv->mgmt_sem)) + if (mutex_lock_interruptible(&priv->mgmt_lock)) return -ERESTARTSYS; prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE); @@ -504,7 +504,7 @@ islpci_mgt_transaction(struct net_device *ndev, /* TODO: we should reset the device here */ out: finish_wait(&priv->mgmt_wqueue, &wait); - up(&priv->mgmt_sem); + mutex_unlock(&priv->mgmt_lock); return err; } diff --git a/drivers/net/wireless/prism54/islpci_mgt.h b/drivers/net/wireless/prism54/islpci_mgt.h index fc53b587b72..f91a88fc1e3 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.h +++ b/drivers/net/wireless/prism54/islpci_mgt.h @@ -86,7 +86,7 @@ extern int pc_debug; #define PIMFOR_FLAG_LITTLE_ENDIAN 0x02 static inline void -add_le32p(u32 * le_number, u32 add) +add_le32p(__le32 * le_number, u32 add) { *le_number = cpu_to_le32(le32_to_cpup(le_number) + add); } |