diff options
Diffstat (limited to 'drivers/net/wireless/p54/p54common.c')
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index bac58ed03e5..de5e8f44b20 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -149,7 +149,8 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
149 | u32 code = le32_to_cpu(bootrec->code); | 149 | u32 code = le32_to_cpu(bootrec->code); |
150 | switch (code) { | 150 | switch (code) { |
151 | case BR_CODE_COMPONENT_ID: | 151 | case BR_CODE_COMPONENT_ID: |
152 | priv->fw_interface = be32_to_cpup(bootrec->data); | 152 | priv->fw_interface = be32_to_cpup((__be32 *) |
153 | bootrec->data); | ||
153 | switch (priv->fw_interface) { | 154 | switch (priv->fw_interface) { |
154 | case FW_FMAC: | 155 | case FW_FMAC: |
155 | printk(KERN_INFO "p54: FreeMAC firmware\n"); | 156 | printk(KERN_INFO "p54: FreeMAC firmware\n"); |
@@ -181,9 +182,8 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
181 | priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500; | 182 | priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500; |
182 | priv->headroom = desc->headroom; | 183 | priv->headroom = desc->headroom; |
183 | priv->tailroom = desc->tailroom; | 184 | priv->tailroom = desc->tailroom; |
184 | if (bootrec->len == 11) | 185 | if (le32_to_cpu(bootrec->len) == 11) |
185 | priv->rx_mtu = (size_t) le16_to_cpu( | 186 | priv->rx_mtu = le16_to_cpu(bootrec->rx_mtu); |
186 | (__le16)bootrec->data[10]); | ||
187 | else | 187 | else |
188 | priv->rx_mtu = (size_t) | 188 | priv->rx_mtu = (size_t) |
189 | 0x620 - priv->tx_hdr_len; | 189 | 0x620 - priv->tx_hdr_len; |
@@ -306,11 +306,11 @@ static int p54_convert_rev1(struct ieee80211_hw *dev, | |||
306 | return 0; | 306 | return 0; |
307 | } | 307 | } |
308 | 308 | ||
309 | const char* p54_rf_chips[] = { "NULL", "Indigo?", "Duette", | 309 | static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette", |
310 | "Frisbee", "Xbow", "Longbow" }; | 310 | "Frisbee", "Xbow", "Longbow" }; |
311 | static int p54_init_xbow_synth(struct ieee80211_hw *dev); | 311 | static int p54_init_xbow_synth(struct ieee80211_hw *dev); |
312 | 312 | ||
313 | int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | 313 | static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) |
314 | { | 314 | { |
315 | struct p54_common *priv = dev->priv; | 315 | struct p54_common *priv = dev->priv; |
316 | struct eeprom_pda_wrap *wrap = NULL; | 316 | struct eeprom_pda_wrap *wrap = NULL; |
@@ -617,7 +617,7 @@ static void p54_rx_eeprom_readback(struct ieee80211_hw *dev, | |||
617 | if (!priv->eeprom) | 617 | if (!priv->eeprom) |
618 | return ; | 618 | return ; |
619 | 619 | ||
620 | memcpy(priv->eeprom, eeprom->data, eeprom->len); | 620 | memcpy(priv->eeprom, eeprom->data, le16_to_cpu(eeprom->len)); |
621 | 621 | ||
622 | complete(&priv->eeprom_comp); | 622 | complete(&priv->eeprom_comp); |
623 | } | 623 | } |
@@ -777,8 +777,9 @@ int p54_read_eeprom(struct ieee80211_hw *dev) | |||
777 | hdr->len = cpu_to_le16(blocksize + sizeof(*eeprom_hdr)); | 777 | hdr->len = cpu_to_le16(blocksize + sizeof(*eeprom_hdr)); |
778 | eeprom_hdr->offset = cpu_to_le16(offset); | 778 | eeprom_hdr->offset = cpu_to_le16(offset); |
779 | eeprom_hdr->len = cpu_to_le16(blocksize); | 779 | eeprom_hdr->len = cpu_to_le16(blocksize); |
780 | p54_assign_address(dev, NULL, hdr, hdr->len + sizeof(*hdr)); | 780 | p54_assign_address(dev, NULL, hdr, le16_to_cpu(hdr->len) + |
781 | priv->tx(dev, hdr, hdr->len + sizeof(*hdr), 0); | 781 | sizeof(*hdr)); |
782 | priv->tx(dev, hdr, le16_to_cpu(hdr->len) + sizeof(*hdr), 0); | ||
782 | 783 | ||
783 | if (!wait_for_completion_interruptible_timeout(&priv->eeprom_comp, HZ)) { | 784 | if (!wait_for_completion_interruptible_timeout(&priv->eeprom_comp, HZ)) { |
784 | printk(KERN_ERR "%s: device does not respond!\n", | 785 | printk(KERN_ERR "%s: device does not respond!\n", |
@@ -1247,18 +1248,20 @@ static void p54_configure_filter(struct ieee80211_hw *dev, | |||
1247 | 1248 | ||
1248 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { | 1249 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { |
1249 | if (*total_flags & FIF_BCN_PRBRESP_PROMISC) | 1250 | if (*total_flags & FIF_BCN_PRBRESP_PROMISC) |
1250 | p54_set_filter(dev, priv->filter_type, NULL); | 1251 | p54_set_filter(dev, le16_to_cpu(priv->filter_type), |
1252 | NULL); | ||
1251 | else | 1253 | else |
1252 | p54_set_filter(dev, priv->filter_type, priv->bssid); | 1254 | p54_set_filter(dev, le16_to_cpu(priv->filter_type), |
1255 | priv->bssid); | ||
1253 | } | 1256 | } |
1254 | 1257 | ||
1255 | if (changed_flags & FIF_PROMISC_IN_BSS) { | 1258 | if (changed_flags & FIF_PROMISC_IN_BSS) { |
1256 | if (*total_flags & FIF_PROMISC_IN_BSS) | 1259 | if (*total_flags & FIF_PROMISC_IN_BSS) |
1257 | p54_set_filter(dev, priv->filter_type | | 1260 | p54_set_filter(dev, le16_to_cpu(priv->filter_type) | |
1258 | cpu_to_le16(0x8), NULL); | 1261 | 0x8, NULL); |
1259 | else | 1262 | else |
1260 | p54_set_filter(dev, priv->filter_type & | 1263 | p54_set_filter(dev, le16_to_cpu(priv->filter_type) & |
1261 | ~cpu_to_le16(0x8), priv->bssid); | 1264 | ~0x8, priv->bssid); |
1262 | } | 1265 | } |
1263 | } | 1266 | } |
1264 | 1267 | ||