aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-07-16 03:54:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:38:03 -0400
commitd89173f25228b8795af2d4b53e985cc44c729332 (patch)
tree5ef89d8520427f4f6877d131a146693f88236fd9
parentc23b5a699471ea2ef9d146eae80e64836cfbf001 (diff)
mwl8k: s/IEEE80211_ADDR_LEN/ETH_ALEN/g
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwl8k.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 91b7062711e7..e8febab61350 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -38,8 +38,6 @@ static DEFINE_PCI_DEVICE_TABLE(mwl8k_table) = {
38}; 38};
39MODULE_DEVICE_TABLE(pci, mwl8k_table); 39MODULE_DEVICE_TABLE(pci, mwl8k_table);
40 40
41#define IEEE80211_ADDR_LEN ETH_ALEN
42
43/* Register definitions */ 41/* Register definitions */
44#define MWL8K_HIU_GEN_PTR 0x00000c10 42#define MWL8K_HIU_GEN_PTR 0x00000c10
45#define MWL8K_MODE_STA 0x0000005a 43#define MWL8K_MODE_STA 0x0000005a
@@ -199,7 +197,7 @@ struct mwl8k_priv {
199 197
200 /* XXX need to convert this to handle multiple interfaces */ 198 /* XXX need to convert this to handle multiple interfaces */
201 bool capture_beacon; 199 bool capture_beacon;
202 u8 capture_bssid[IEEE80211_ADDR_LEN]; 200 u8 capture_bssid[ETH_ALEN];
203 struct sk_buff *beacon_skb; 201 struct sk_buff *beacon_skb;
204 202
205 /* 203 /*
@@ -228,8 +226,8 @@ struct mwl8k_vif {
228 struct ieee80211_bss_conf bss_info; 226 struct ieee80211_bss_conf bss_info;
229 227
230 /* BSSID of AP or IBSS */ 228 /* BSSID of AP or IBSS */
231 u8 bssid[IEEE80211_ADDR_LEN]; 229 u8 bssid[ETH_ALEN];
232 u8 mac_addr[IEEE80211_ADDR_LEN]; 230 u8 mac_addr[ETH_ALEN];
233 231
234 /* 232 /*
235 * Subset of supported legacy rates. 233 * Subset of supported legacy rates.
@@ -785,7 +783,7 @@ static inline struct sk_buff *mwl8k_add_dma_header(struct sk_buff *skb)
785 memmove(&tr->wh, wh, hdrlen); 783 memmove(&tr->wh, wh, hdrlen);
786 784
787 /* Clear addr4 */ 785 /* Clear addr4 */
788 memset(tr->wh.addr4, 0, IEEE80211_ADDR_LEN); 786 memset(tr->wh.addr4, 0, ETH_ALEN);
789 787
790 /* 788 /*
791 * Firmware length is the length of the fully formed "802.11 789 * Firmware length is the length of the fully formed "802.11
@@ -952,7 +950,7 @@ static inline void mwl8k_save_beacon(struct mwl8k_priv *priv,
952 struct sk_buff *skb) 950 struct sk_buff *skb)
953{ 951{
954 priv->capture_beacon = false; 952 priv->capture_beacon = false;
955 memset(priv->capture_bssid, 0, IEEE80211_ADDR_LEN); 953 memset(priv->capture_bssid, 0, ETH_ALEN);
956 954
957 /* 955 /*
958 * Use GFP_ATOMIC as rxq_process is called from 956 * Use GFP_ATOMIC as rxq_process is called from
@@ -1067,7 +1065,7 @@ struct mwl8k_tx_desc {
1067 __le16 qos_control; 1065 __le16 qos_control;
1068 __le32 pkt_phys_addr; 1066 __le32 pkt_phys_addr;
1069 __le16 pkt_len; 1067 __le16 pkt_len;
1070 __u8 dest_MAC_addr[IEEE80211_ADDR_LEN]; 1068 __u8 dest_MAC_addr[ETH_ALEN];
1071 __le32 next_tx_desc_phys_addr; 1069 __le32 next_tx_desc_phys_addr;
1072 __le32 reserved; 1070 __le32 reserved;
1073 __le16 rate_info; 1071 __le16 rate_info;
@@ -1587,7 +1585,7 @@ struct mwl8k_cmd_get_hw_spec {
1587 __u8 hw_rev; 1585 __u8 hw_rev;
1588 __u8 host_interface; 1586 __u8 host_interface;
1589 __le16 num_mcaddrs; 1587 __le16 num_mcaddrs;
1590 __u8 perm_addr[IEEE80211_ADDR_LEN]; 1588 __u8 perm_addr[ETH_ALEN];
1591 __le16 region_code; 1589 __le16 region_code;
1592 __le32 fw_rev; 1590 __le32 fw_rev;
1593 __le32 ps_cookie; 1591 __le32 ps_cookie;
@@ -1644,7 +1642,7 @@ struct mwl8k_cmd_mac_multicast_adr {
1644 struct mwl8k_cmd_pkt header; 1642 struct mwl8k_cmd_pkt header;
1645 __le16 action; 1643 __le16 action;
1646 __le16 numaddr; 1644 __le16 numaddr;
1647 __u8 addr[1][IEEE80211_ADDR_LEN]; 1645 __u8 addr[1][ETH_ALEN];
1648}; 1646};
1649 1647
1650#define MWL8K_ENABLE_RX_MULTICAST 0x000F 1648#define MWL8K_ENABLE_RX_MULTICAST 0x000F
@@ -1655,7 +1653,7 @@ static int mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw,
1655 struct mwl8k_cmd_mac_multicast_adr *cmd; 1653 struct mwl8k_cmd_mac_multicast_adr *cmd;
1656 int index = 0; 1654 int index = 0;
1657 int rc; 1655 int rc;
1658 int size = sizeof(*cmd) + ((mc_count - 1) * IEEE80211_ADDR_LEN); 1656 int size = sizeof(*cmd) + ((mc_count - 1) * ETH_ALEN);
1659 cmd = kzalloc(size, GFP_KERNEL); 1657 cmd = kzalloc(size, GFP_KERNEL);
1660 if (cmd == NULL) 1658 if (cmd == NULL)
1661 return -ENOMEM; 1659 return -ENOMEM;
@@ -1665,11 +1663,11 @@ static int mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw,
1665 cmd->action = cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST); 1663 cmd->action = cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
1666 cmd->numaddr = cpu_to_le16(mc_count); 1664 cmd->numaddr = cpu_to_le16(mc_count);
1667 while ((index < mc_count) && mclist) { 1665 while ((index < mc_count) && mclist) {
1668 if (mclist->da_addrlen != IEEE80211_ADDR_LEN) { 1666 if (mclist->da_addrlen != ETH_ALEN) {
1669 rc = -EINVAL; 1667 rc = -EINVAL;
1670 goto mwl8k_cmd_mac_multicast_adr_exit; 1668 goto mwl8k_cmd_mac_multicast_adr_exit;
1671 } 1669 }
1672 memcpy(cmd->addr[index], mclist->da_addr, IEEE80211_ADDR_LEN); 1670 memcpy(cmd->addr[index], mclist->da_addr, ETH_ALEN);
1673 index++; 1671 index++;
1674 mclist = mclist->next; 1672 mclist = mclist->next;
1675 } 1673 }
@@ -1848,11 +1846,11 @@ static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw)
1848struct mwl8k_cmd_set_post_scan { 1846struct mwl8k_cmd_set_post_scan {
1849 struct mwl8k_cmd_pkt header; 1847 struct mwl8k_cmd_pkt header;
1850 __le32 isibss; 1848 __le32 isibss;
1851 __u8 bssid[IEEE80211_ADDR_LEN]; 1849 __u8 bssid[ETH_ALEN];
1852} __attribute__((packed)); 1850} __attribute__((packed));
1853 1851
1854static int 1852static int
1855mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, __u8 mac[IEEE80211_ADDR_LEN]) 1853mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, __u8 mac[ETH_ALEN])
1856{ 1854{
1857 struct mwl8k_cmd_set_post_scan *cmd; 1855 struct mwl8k_cmd_set_post_scan *cmd;
1858 int rc; 1856 int rc;
@@ -1864,7 +1862,7 @@ mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, __u8 mac[IEEE80211_ADDR_LEN])
1864 cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_POST_SCAN); 1862 cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_POST_SCAN);
1865 cmd->header.length = cpu_to_le16(sizeof(*cmd)); 1863 cmd->header.length = cpu_to_le16(sizeof(*cmd));
1866 cmd->isibss = 0; 1864 cmd->isibss = 0;
1867 memcpy(cmd->bssid, mac, IEEE80211_ADDR_LEN); 1865 memcpy(cmd->bssid, mac, ETH_ALEN);
1868 1866
1869 rc = mwl8k_post_cmd(hw, &cmd->header); 1867 rc = mwl8k_post_cmd(hw, &cmd->header);
1870 kfree(cmd); 1868 kfree(cmd);
@@ -2216,7 +2214,7 @@ struct mwl8k_cmd_update_sta_db {
2216 __le32 action; 2214 __le32 action;
2217 2215
2218 /* Peer MAC address */ 2216 /* Peer MAC address */
2219 __u8 peer_addr[IEEE80211_ADDR_LEN]; 2217 __u8 peer_addr[ETH_ALEN];
2220 2218
2221 __le32 reserved; 2219 __le32 reserved;
2222 2220
@@ -2244,7 +2242,7 @@ static int mwl8k_cmd_update_sta_db(struct ieee80211_hw *hw,
2244 2242
2245 cmd->action = cpu_to_le32(action); 2243 cmd->action = cpu_to_le32(action);
2246 peer_info = &cmd->peer_info; 2244 peer_info = &cmd->peer_info;
2247 memcpy(cmd->peer_addr, mv_vif->bssid, IEEE80211_ADDR_LEN); 2245 memcpy(cmd->peer_addr, mv_vif->bssid, ETH_ALEN);
2248 2246
2249 switch (action) { 2247 switch (action) {
2250 case MWL8K_STA_DB_ADD_ENTRY: 2248 case MWL8K_STA_DB_ADD_ENTRY:
@@ -2293,7 +2291,7 @@ struct mwl8k_cmd_update_set_aid {
2293 __le16 aid; 2291 __le16 aid;
2294 2292
2295 /* AP's MAC address (BSSID) */ 2293 /* AP's MAC address (BSSID) */
2296 __u8 bssid[IEEE80211_ADDR_LEN]; 2294 __u8 bssid[ETH_ALEN];
2297 __le16 protection_mode; 2295 __le16 protection_mode;
2298 __u8 supp_rates[MWL8K_RATE_INDEX_MAX_ARRAY]; 2296 __u8 supp_rates[MWL8K_RATE_INDEX_MAX_ARRAY];
2299} __attribute__((packed)); 2297} __attribute__((packed));
@@ -2317,7 +2315,7 @@ static int mwl8k_cmd_set_aid(struct ieee80211_hw *hw,
2317 cmd->header.length = cpu_to_le16(sizeof(*cmd)); 2315 cmd->header.length = cpu_to_le16(sizeof(*cmd));
2318 cmd->aid = cpu_to_le16(info->aid); 2316 cmd->aid = cpu_to_le16(info->aid);
2319 2317
2320 memcpy(cmd->bssid, mv_vif->bssid, IEEE80211_ADDR_LEN); 2318 memcpy(cmd->bssid, mv_vif->bssid, ETH_ALEN);
2321 2319
2322 prot_mode = MWL8K_FRAME_PROT_DISABLED; 2320 prot_mode = MWL8K_FRAME_PROT_DISABLED;
2323 2321
@@ -2934,7 +2932,7 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw,
2934 memset(mwl8k_vif, 0, sizeof(*mwl8k_vif)); 2932 memset(mwl8k_vif, 0, sizeof(*mwl8k_vif));
2935 2933
2936 /* Save the mac address */ 2934 /* Save the mac address */
2937 memcpy(mwl8k_vif->mac_addr, conf->mac_addr, IEEE80211_ADDR_LEN); 2935 memcpy(mwl8k_vif->mac_addr, conf->mac_addr, ETH_ALEN);
2938 2936
2939 /* Back pointer to parent config block */ 2937 /* Back pointer to parent config block */
2940 mwl8k_vif->priv = priv; 2938 mwl8k_vif->priv = priv;
@@ -3091,14 +3089,13 @@ static int mwl8k_bss_info_changed_wt(struct work_struct *wt)
3091 * Finalize the join. Tell rx handler to process 3089 * Finalize the join. Tell rx handler to process
3092 * next beacon from our BSSID. 3090 * next beacon from our BSSID.
3093 */ 3091 */
3094 memcpy(priv->capture_bssid, 3092 memcpy(priv->capture_bssid, mwl8k_vif->bssid, ETH_ALEN);
3095 mwl8k_vif->bssid, IEEE80211_ADDR_LEN);
3096 priv->capture_beacon = true; 3093 priv->capture_beacon = true;
3097 } else { 3094 } else {
3098 mwl8k_cmd_update_sta_db(hw, vif, MWL8K_STA_DB_DEL_ENTRY); 3095 mwl8k_cmd_update_sta_db(hw, vif, MWL8K_STA_DB_DEL_ENTRY);
3099 memset(&mwl8k_vif->bss_info, 0, 3096 memset(&mwl8k_vif->bss_info, 0,
3100 sizeof(struct ieee80211_bss_conf)); 3097 sizeof(struct ieee80211_bss_conf));
3101 memset(mwl8k_vif->bssid, 0, IEEE80211_ADDR_LEN); 3098 memset(mwl8k_vif->bssid, 0, ETH_ALEN);
3102 } 3099 }
3103 3100
3104mwl8k_bss_info_changed_exit: 3101mwl8k_bss_info_changed_exit:
@@ -3117,7 +3114,7 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw,
3117 int rc; 3114 int rc;
3118 3115
3119 if (changed & BSS_CHANGED_BSSID) 3116 if (changed & BSS_CHANGED_BSSID)
3120 memcpy(mv_vif->bssid, info->bssid, IEEE80211_ADDR_LEN); 3117 memcpy(mv_vif->bssid, info->bssid, ETH_ALEN);
3121 3118
3122 if ((changed & BSS_CHANGED_ASSOC) == 0) 3119 if ((changed & BSS_CHANGED_ASSOC) == 0)
3123 return; 3120 return;