20 #include <linux/slab.h>
23 #include <linux/export.h>
46 while (data < end_data && *data)
49 while (data < end_data && !*data)
52 bootrec = (
struct bootrec *) data;
54 while (bootrec->
data <= end_data && (bootrec->
data +
67 "p54 detected a LM%c%c firmware\n",
68 iftype[2], iftype[3]);
74 "unsupported firmware\n");
80 if (
strnlen((
unsigned char *) bootrec->
data, 24) < 24)
81 fw_version = (
unsigned char *) bootrec->
data;
104 "to %d\n", priv->
rx_mtu, maxlen);
110 exp_if = (
struct exp_if *) bootrec->
data;
111 for (i = 0; i < (len *
sizeof(*exp_if) / 4); i++)
124 bootrec = (
struct bootrec *)&bootrec->
data[len];
129 "FW rev %s - Softmac protocol %x.%x\n",
133 priv->fw_var >> 8,
priv->fw_var & 0xff);
136 if (
priv->fw_var < 0x500)
138 "you are using an obsolete firmware. "
139 "visit http://wireless.kernel.org/en/users/Drivers/p54 "
140 "and grab one for \"kernel >= 2.6.28\"!\n");
142 if (
priv->fw_var >= 0x300) {
145 if (
priv->fw_var >= 0x500) {
160 "cryptographic accelerator WEP:%s, TKIP:%s, CCMP:%s\n",
162 (
priv->privacy_caps &
168 if (
priv->rx_keycache_size) {
183 if (!
priv->used_rxkeys)
204 skb = __dev_alloc_skb(priv->
tx_hdr_len + frame_len, memflags);
222 size_t eeprom_hdr_size;
225 if (priv->
fw_var >= 0x509)
226 eeprom_hdr_size =
sizeof(*eeprom_hdr);
228 eeprom_hdr_size = 0x4;
239 eeprom_hdr_size + len);
241 if (priv->
fw_var < 0x509) {
247 eeprom_hdr->
v2.magic2 = 0xf;
248 memcpy(eeprom_hdr->
v2.magic, (
const char *)
"LOCK", 4);
255 wiphy_err(priv->
hw->wiphy,
"device does not respond!\n");
329 switch (priv->
mode) {
365 if (priv->
fw_var < 0x500) {
380 setup->
v2.sbss_offset = 0;
381 setup->
v2.mcast_window = 0;
382 setup->
v2.rx_rssi_threshold = 0;
383 setup->
v2.rx_ed_threshold = 0;
408 2 +
sizeof(*iq_autocal) +
sizeof(*body) +
409 sizeof(*rate) + 2 *
sizeof(*rssi),
425 iq_autocal = (
void *)
skb_put(skb,
sizeof(*iq_autocal));
446 if (*entry_freq != freq)
451 (
void *) entry_freq +
sizeof(
__le16),
457 body->
normal.val_barker = 0x38;
473 for (i = 0; i < priv->
curve_data->entries; i++) {
500 if ((priv->
fw_var >= 0x500) && (priv->
fw_var < 0x509)) {
501 rate = (
void *)
skb_put(skb,
sizeof(*rate));
503 for (i = 0; i <
sizeof(rate->
rts_rates); i++)
513 rssi = (
void *)
skb_put(skb,
sizeof(*rssi));
518 if (priv->
fw_var >= 0x509) {
519 rate = (
void *)
skb_put(skb,
sizeof(*rate));
521 for (i = 0; i <
sizeof(rate->
rts_rates); i++)
533 wiphy_err(priv->
hw->wiphy,
"frequency change to channel %d failed.\n",
535 priv->
hw->conf.channel->center_freq));
695 "invalid cryptographic algorithm: %d\n", algo);
726 txinfo = IEEE80211_SKB_CB(skb);