diff options
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/baseband.c | 40 | ||||
-rw-r--r-- | drivers/staging/vt6656/card.c | 18 | ||||
-rw-r--r-- | drivers/staging/vt6656/channel.c | 97 | ||||
-rw-r--r-- | drivers/staging/vt6656/device.h | 11 | ||||
-rw-r--r-- | drivers/staging/vt6656/mac.c | 14 | ||||
-rw-r--r-- | drivers/staging/vt6656/mac.h | 22 | ||||
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 6 | ||||
-rw-r--r-- | drivers/staging/vt6656/rf.c | 414 | ||||
-rw-r--r-- | drivers/staging/vt6656/rxtx.c | 10 | ||||
-rw-r--r-- | drivers/staging/vt6656/usbpipe.c | 4 | ||||
-rw-r--r-- | drivers/staging/vt6656/wcmd.c | 13 |
11 files changed, 50 insertions, 599 deletions
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index 1e1c5a7d8968..ad7b963f0d98 100644 --- a/drivers/staging/vt6656/baseband.c +++ b/drivers/staging/vt6656/baseband.c @@ -167,30 +167,6 @@ static const struct vnt_threshold vt3226_vnt_threshold[] = { {41, 0xff, 0x00} }; -static const struct vnt_threshold vt3342_vnt_threshold[] = { - {0, 0x00, 0x38}, /* Max sensitivity */ - {66, 0x00, 0x43}, - {65, 0x00, 0x52}, - {64, 0x00, 0x68}, - {63, 0x00, 0x80}, - {62, 0x00, 0x9c}, - {61, 0x00, 0xc0}, - {60, 0x00, 0xea}, - {59, 0x01, 0x30}, - {58, 0x01, 0x70}, - {57, 0x01, 0xb0}, - {56, 0x02, 0x30}, - {55, 0x02, 0xc0}, - {53, 0x04, 0x00}, - {51, 0x07, 0x00}, - {49, 0x0a, 0x00}, - {47, 0x11, 0x00}, - {45, 0x18, 0x00}, - {43, 0x26, 0x00}, - {42, 0x36, 0x00}, - {41, 0xff, 0x00} -}; - /* * Description: Set Antenna mode * @@ -255,23 +231,18 @@ int vnt_vt3184_init(struct vnt_private *priv) dev_dbg(&priv->usb->dev, "RF Type %d\n", priv->rf_type); if ((priv->rf_type == RF_AL2230) || - (priv->rf_type == RF_AL2230S) || - (priv->rf_type == RF_AIROHA7230)) { + (priv->rf_type == RF_AL2230S)) { priv->bb_rx_conf = vnt_vt3184_al2230[10]; length = sizeof(vnt_vt3184_al2230); addr = vnt_vt3184_al2230; - if (priv->rf_type == RF_AIROHA7230) - addr[0xd7] = 0x06; - priv->bb_vga[0] = 0x1c; priv->bb_vga[1] = 0x10; priv->bb_vga[2] = 0x0; priv->bb_vga[3] = 0x0; } else if ((priv->rf_type == RF_VT3226) || - (priv->rf_type == RF_VT3226D0) || - (priv->rf_type == RF_VT3342A0)) { + (priv->rf_type == RF_VT3226D0)) { priv->bb_rx_conf = vnt_vt3184_vt3226d0[10]; length = sizeof(vnt_vt3184_vt3226d0); c_addr = vnt_vt3184_vt3226d0; @@ -305,7 +276,6 @@ int vnt_vt3184_init(struct vnt_private *priv) goto end; if ((priv->rf_type == RF_VT3226) || - (priv->rf_type == RF_VT3342A0) || (priv->rf_type == RF_VT3226D0)) { data = (priv->rf_type == RF_VT3226D0) ? 0x11 : 0x23; @@ -446,7 +416,6 @@ int vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning) switch (priv->rf_type) { case RF_AL2230: case RF_AL2230S: - case RF_AIROHA7230: threshold = al2230_vnt_threshold; length = ARRAY_SIZE(al2230_vnt_threshold); break; @@ -456,11 +425,6 @@ int vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning) threshold = vt3226_vnt_threshold; length = ARRAY_SIZE(vt3226_vnt_threshold); break; - - case RF_VT3342A0: - threshold = vt3342_vnt_threshold; - length = ARRAY_SIZE(vt3342_vnt_threshold); - break; } if (!threshold) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index e92ecfad26d2..7827e579ef3d 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -369,10 +369,8 @@ int vnt_radio_power_off(struct vnt_private *priv) switch (priv->rf_type) { case RF_AL2230: case RF_AL2230S: - case RF_AIROHA7230: case RF_VT3226: case RF_VT3226D0: - case RF_VT3342A0: ret = vnt_mac_reg_bits_off(priv, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); @@ -423,10 +421,8 @@ int vnt_radio_power_on(struct vnt_private *priv) switch (priv->rf_type) { case RF_AL2230: case RF_AL2230S: - case RF_AIROHA7230: case RF_VT3226: case RF_VT3226D0: - case RF_VT3342A0: ret = vnt_mac_reg_bits_on(priv, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); @@ -442,12 +438,8 @@ int vnt_set_bss_mode(struct vnt_private *priv) int ret; unsigned char type = priv->bb_type; unsigned char data = 0; - unsigned char bb_vga_0 = 0x1c; unsigned char bb_vga_2_3 = 0x00; - if (priv->rf_type == RF_AIROHA7230 && priv->bb_type == BB_TYPE_11A) - type = BB_TYPE_11G; - ret = vnt_mac_set_bb_type(priv, type); if (ret) return ret; @@ -456,7 +448,6 @@ int vnt_set_bss_mode(struct vnt_private *priv) if (priv->bb_type == BB_TYPE_11A) { data = 0x03; - bb_vga_0 = 0x20; bb_vga_2_3 = 0x10; } else if (priv->bb_type == BB_TYPE_11B) { data = 0x02; @@ -479,15 +470,6 @@ int vnt_set_bss_mode(struct vnt_private *priv) if (ret) return ret; - if (priv->rf_type == RF_AIROHA7230) { - priv->bb_vga[0] = bb_vga_0; - - ret = vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, - 0xe7, priv->bb_vga[0]); - if (ret) - return ret; - } - priv->bb_vga[2] = bb_vga_2_3; priv->bb_vga[3] = bb_vga_2_3; diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c index eb2d52e6420b..413e2fc4a50d 100644 --- a/drivers/staging/vt6656/channel.c +++ b/drivers/staging/vt6656/channel.c @@ -38,17 +38,6 @@ static struct ieee80211_rate vnt_rates_bg[] = { { .bitrate = 540, .hw_value = RATE_54M }, }; -static struct ieee80211_rate vnt_rates_a[] = { - { .bitrate = 60, .hw_value = RATE_6M }, - { .bitrate = 90, .hw_value = RATE_9M }, - { .bitrate = 120, .hw_value = RATE_12M }, - { .bitrate = 180, .hw_value = RATE_18M }, - { .bitrate = 240, .hw_value = RATE_24M }, - { .bitrate = 360, .hw_value = RATE_36M }, - { .bitrate = 480, .hw_value = RATE_48M }, - { .bitrate = 540, .hw_value = RATE_54M }, -}; - static struct ieee80211_channel vnt_channels_2ghz[] = { { .center_freq = 2412, .hw_value = 1 }, { .center_freq = 2417, .hw_value = 2 }, @@ -66,51 +55,6 @@ static struct ieee80211_channel vnt_channels_2ghz[] = { { .center_freq = 2484, .hw_value = 14 } }; -static struct ieee80211_channel vnt_channels_5ghz[] = { - { .center_freq = 4915, .hw_value = 15 }, - { .center_freq = 4920, .hw_value = 16 }, - { .center_freq = 4925, .hw_value = 17 }, - { .center_freq = 4935, .hw_value = 18 }, - { .center_freq = 4940, .hw_value = 19 }, - { .center_freq = 4945, .hw_value = 20 }, - { .center_freq = 4960, .hw_value = 21 }, - { .center_freq = 4980, .hw_value = 22 }, - { .center_freq = 5035, .hw_value = 23 }, - { .center_freq = 5040, .hw_value = 24 }, - { .center_freq = 5045, .hw_value = 25 }, - { .center_freq = 5055, .hw_value = 26 }, - { .center_freq = 5060, .hw_value = 27 }, - { .center_freq = 5080, .hw_value = 28 }, - { .center_freq = 5170, .hw_value = 29 }, - { .center_freq = 5180, .hw_value = 30 }, - { .center_freq = 5190, .hw_value = 31 }, - { .center_freq = 5200, .hw_value = 32 }, - { .center_freq = 5210, .hw_value = 33 }, - { .center_freq = 5220, .hw_value = 34 }, - { .center_freq = 5230, .hw_value = 35 }, - { .center_freq = 5240, .hw_value = 36 }, - { .center_freq = 5260, .hw_value = 37 }, - { .center_freq = 5280, .hw_value = 38 }, - { .center_freq = 5300, .hw_value = 39 }, - { .center_freq = 5320, .hw_value = 40 }, - { .center_freq = 5500, .hw_value = 41 }, - { .center_freq = 5520, .hw_value = 42 }, - { .center_freq = 5540, .hw_value = 43 }, - { .center_freq = 5560, .hw_value = 44 }, - { .center_freq = 5580, .hw_value = 45 }, - { .center_freq = 5600, .hw_value = 46 }, - { .center_freq = 5620, .hw_value = 47 }, - { .center_freq = 5640, .hw_value = 48 }, - { .center_freq = 5660, .hw_value = 49 }, - { .center_freq = 5680, .hw_value = 50 }, - { .center_freq = 5700, .hw_value = 51 }, - { .center_freq = 5745, .hw_value = 52 }, - { .center_freq = 5765, .hw_value = 53 }, - { .center_freq = 5785, .hw_value = 54 }, - { .center_freq = 5805, .hw_value = 55 }, - { .center_freq = 5825, .hw_value = 56 } -}; - static struct ieee80211_supported_band vnt_supported_2ghz_band = { .channels = vnt_channels_2ghz, .n_channels = ARRAY_SIZE(vnt_channels_2ghz), @@ -118,45 +62,16 @@ static struct ieee80211_supported_band vnt_supported_2ghz_band = { .n_bitrates = ARRAY_SIZE(vnt_rates_bg), }; -static struct ieee80211_supported_band vnt_supported_5ghz_band = { - .channels = vnt_channels_5ghz, - .n_channels = ARRAY_SIZE(vnt_channels_5ghz), - .bitrates = vnt_rates_a, - .n_bitrates = ARRAY_SIZE(vnt_rates_a), -}; - void vnt_init_bands(struct vnt_private *priv) { struct ieee80211_channel *ch; int i; - switch (priv->rf_type) { - case RF_AIROHA7230: - case RF_VT3342A0: - default: - ch = vnt_channels_5ghz; - - for (i = 0; i < ARRAY_SIZE(vnt_channels_5ghz); i++) { - ch[i].max_power = VNT_RF_MAX_POWER; - ch[i].flags = IEEE80211_CHAN_NO_HT40; - } - - priv->hw->wiphy->bands[NL80211_BAND_5GHZ] = - &vnt_supported_5ghz_band; - fallthrough; - case RF_AL2230: - case RF_AL2230S: - case RF_VT3226: - case RF_VT3226D0: - ch = vnt_channels_2ghz; - - for (i = 0; i < ARRAY_SIZE(vnt_channels_2ghz); i++) { - ch[i].max_power = VNT_RF_MAX_POWER; - ch[i].flags = IEEE80211_CHAN_NO_HT40; - } - - priv->hw->wiphy->bands[NL80211_BAND_2GHZ] = - &vnt_supported_2ghz_band; - break; + ch = vnt_channels_2ghz; + for (i = 0; i < ARRAY_SIZE(vnt_channels_2ghz); i++) { + ch[i].max_power = VNT_RF_MAX_POWER; + ch[i].flags = IEEE80211_CHAN_NO_HT40; } + priv->hw->wiphy->bands[NL80211_BAND_2GHZ] = + &vnt_supported_2ghz_band; } diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index 8b6623a751f0..ca974d61d3f4 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -268,8 +268,8 @@ struct vnt_private { u32 rx_buf_sz; int mc_list_count; - spinlock_t lock; - struct mutex usb_lock; + spinlock_t lock; /* prepare tx USB URB */ + struct mutex usb_lock; /* USB control messages */ unsigned long flags; @@ -381,13 +381,6 @@ struct vnt_private { struct ieee80211_low_level_stats low_stats; }; -#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \ - if ((uVar) >= ((uModulo) - 1)) \ - (uVar) = 0; \ - else \ - (uVar)++; \ -} - int vnt_init(struct vnt_private *priv); #endif diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c index 4f1f9b03a678..49430c0a99b8 100644 --- a/drivers/staging/vt6656/mac.c +++ b/drivers/staging/vt6656/mac.c @@ -39,7 +39,7 @@ int vnt_mac_set_bb_type(struct vnt_private *priv, u8 type) u8 data[2]; data[0] = type; - data[1] = EnCFG_BBType_MASK; + data[1] = EN_CFG_BB_TYPE_MASK; return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), @@ -120,8 +120,8 @@ int vnt_mac_enable_protect_mode(struct vnt_private *priv) { u8 data[2]; - data[0] = EnCFG_ProtectMd; - data[1] = EnCFG_ProtectMd; + data[0] = EN_CFG_PROTECT_MD; + data[1] = EN_CFG_PROTECT_MD; return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); @@ -132,7 +132,7 @@ int vnt_mac_disable_protect_mode(struct vnt_private *priv) u8 data[2]; data[0] = 0; - data[1] = EnCFG_ProtectMd; + data[1] = EN_CFG_PROTECT_MD; return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); @@ -142,8 +142,8 @@ int vnt_mac_enable_barker_preamble_mode(struct vnt_private *priv) { u8 data[2]; - data[0] = EnCFG_BarkerPream; - data[1] = EnCFG_BarkerPream; + data[0] = EN_CFG_BARKER_PREAM; + data[1] = EN_CFG_BARKER_PREAM; return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); @@ -154,7 +154,7 @@ int vnt_mac_disable_barker_preamble_mode(struct vnt_private *priv) u8 data[2]; data[0] = 0; - data[1] = EnCFG_BarkerPream; + data[1] = EN_CFG_BARKER_PREAM; return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h index 05af9ca7d69c..0ac845bd3c5a 100644 --- a/drivers/staging/vt6656/mac.h +++ b/drivers/staging/vt6656/mac.h @@ -172,20 +172,20 @@ #define TFTCTL_TSFCNTREN BIT(0) /* Bits in the EnhanceCFG_0 register */ -#define EnCFG_BBType_a 0x00 -#define EnCFG_BBType_b BIT(0) -#define EnCFG_BBType_g BIT(1) -#define EnCFG_BBType_MASK (EnCFG_BBType_b | EnCFG_BBType_g) -#define EnCFG_ProtectMd BIT(5) +#define EN_CFG_BB_TYPE_A 0x00 +#define EN_CFG_BB_TYPE_B BIT(0) +#define EN_CFG_BB_TYPE_G BIT(1) +#define EN_CFG_BB_TYPE_MASK (EN_CFG_BB_TYPE_B | EN_CFG_BB_TYPE_G) +#define EN_CFG_PROTECT_MD BIT(5) /* Bits in the EnhanceCFG_1 register */ -#define EnCFG_BcnSusInd BIT(0) -#define EnCFG_BcnSusClr BIT(1) +#define EN_CFG_BCN_SUS_IND BIT(0) +#define EN_CFG_BCN_SUS_CLR BIT(1) /* Bits in the EnhanceCFG_2 register */ -#define EnCFG_NXTBTTCFPSTR BIT(0) -#define EnCFG_BarkerPream BIT(1) -#define EnCFG_PktBurstMode BIT(2) +#define EN_CFG_NXTBTTCFPSTR BIT(0) +#define EN_CFG_BARKER_PREAM BIT(1) +#define EN_CFG_PKT_BURST_MD BIT(2) /* Bits in the CFG register */ #define CFG_TKIPOPT BIT(7) @@ -333,7 +333,7 @@ #define PKT_TYPE_ERROR_CRC BIT(1) #define PKT_TYPE_BSSID BIT(0) -#define Default_BI 0x200 +#define DEFAULT_BI 0x200 /* MiscFIFO Offset */ #define MISCFIFO_KEYETRY0 32 diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index ae7f5916d4d6..897ee0f7fc6b 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -745,11 +745,11 @@ static int vnt_config(struct ieee80211_hw *hw, u32 changed) static void vnt_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - struct ieee80211_bss_conf *conf, u32 changed) + struct ieee80211_bss_conf *conf, u64 changed) { struct vnt_private *priv = hw->priv; - priv->current_aid = conf->aid; + priv->current_aid = vif->cfg.aid; if (changed & BSS_CHANGED_BSSID && conf->bssid) vnt_mac_set_bssid_addr(priv, (u8 *)conf->bssid); @@ -811,7 +811,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BEACON_INFO) && priv->op_mode != NL80211_IFTYPE_AP) { - if (conf->assoc && conf->beacon_rate) { + if (vif->cfg.assoc && conf->beacon_rate) { u16 ps_beacon_int = conf->beacon_int; if (conf->dtim_period) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index b9c06b312ae1..464602c74727 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -82,221 +82,6 @@ static u8 al2230_channel_table1[CB_MAX_CHANNEL_24G][3] = { {0x06, 0x66, 0x61} }; -static u8 al7230_init_table[CB_AL7230_INIT_SEQ][3] = { - {0x20, 0x37, 0x90}, - {0x13, 0x33, 0x31}, - {0x84, 0x1f, 0xf2}, - {0x3f, 0xdf, 0xa3}, - {0x7f, 0xd7, 0x84}, - {0x80, 0x2b, 0x55}, - {0x56, 0xaf, 0x36}, - {0xce, 0x02, 0x07}, - {0x6e, 0xbc, 0x98}, - {0x22, 0x1b, 0xb9}, - {0xe0, 0x00, 0x0a}, - {0x08, 0x03, 0x1b}, - {0x00, 0x0a, 0x3c}, - {0xff, 0xff, 0xfd}, - {0x00, 0x00, 0x0e}, - {0x1a, 0xba, 0x8f} -}; - -static u8 al7230_init_table_amode[CB_AL7230_INIT_SEQ][3] = { - {0x2f, 0xf5, 0x20}, - {0x00, 0x00, 0x01}, - {0x45, 0x1f, 0xe2}, - {0x5f, 0xdf, 0xa3}, - {0x6f, 0xd7, 0x84}, - {0x85, 0x3f, 0x55}, - {0x56, 0xaf, 0x36}, - {0xce, 0x02, 0x07}, - {0x6e, 0xbc, 0x98}, - {0x22, 0x1b, 0xb9}, - {0xe0, 0x60, 0x0a}, - {0x08, 0x03, 0x1b}, - {0x00, 0x14, 0x7c}, - {0xff, 0xff, 0xfd}, - {0x00, 0x00, 0x0e}, - {0x12, 0xba, 0xcf} -}; - -static u8 al7230_channel_table0[CB_MAX_CHANNEL][3] = { - {0x20, 0x37, 0x90}, - {0x20, 0x37, 0x90}, - {0x20, 0x37, 0x90}, - {0x20, 0x37, 0x90}, - {0x20, 0x37, 0xa0}, - {0x20, 0x37, 0xa0}, - {0x20, 0x37, 0xa0}, - {0x20, 0x37, 0xa0}, - {0x20, 0x37, 0xb0}, - {0x20, 0x37, 0xb0}, - {0x20, 0x37, 0xb0}, - {0x20, 0x37, 0xb0}, - {0x20, 0x37, 0xc0}, - {0x20, 0x37, 0xc0}, - {0x0f, 0xf5, 0x20}, /* channel 15 Tf = 4915MHz */ - {0x2f, 0xf5, 0x20}, - {0x0f, 0xf5, 0x20}, - {0x0f, 0xf5, 0x20}, - {0x2f, 0xf5, 0x20}, - {0x0f, 0xf5, 0x20}, - {0x2f, 0xf5, 0x30}, - {0x2f, 0xf5, 0x30}, - {0x0f, 0xf5, 0x40}, - {0x2f, 0xf5, 0x40}, - {0x0f, 0xf5, 0x40}, - {0x0f, 0xf5, 0x40}, - {0x2f, 0xf5, 0x40}, - {0x2f, 0xf5, 0x50}, - {0x2f, 0xf5, 0x60}, - {0x2f, 0xf5, 0x60}, - {0x2f, 0xf5, 0x70}, - {0x2f, 0xf5, 0x70}, - {0x2f, 0xf5, 0x70}, - {0x2f, 0xf5, 0x70}, - {0x2f, 0xf5, 0x70}, - {0x2f, 0xf5, 0x70}, - {0x2f, 0xf5, 0x80}, - {0x2f, 0xf5, 0x80}, - {0x2f, 0xf5, 0x80}, - {0x2f, 0xf5, 0x90}, - {0x2f, 0xf5, 0xc0}, - {0x2f, 0xf5, 0xc0}, - {0x2f, 0xf5, 0xc0}, - {0x2f, 0xf5, 0xd0}, - {0x2f, 0xf5, 0xd0}, - {0x2f, 0xf5, 0xd0}, - {0x2f, 0xf5, 0xe0}, - {0x2f, 0xf5, 0xe0}, - {0x2f, 0xf5, 0xe0}, - {0x2f, 0xf5, 0xf0}, - {0x2f, 0xf5, 0xf0}, - {0x2f, 0xf6, 0x00}, - {0x2f, 0xf6, 0x00}, - {0x2f, 0xf6, 0x00}, - {0x2f, 0xf6, 0x10}, - {0x2f, 0xf6, 0x10} -}; - -static u8 al7230_channel_table1[CB_MAX_CHANNEL][3] = { - {0x13, 0x33, 0x31}, - {0x1b, 0x33, 0x31}, - {0x03, 0x33, 0x31}, - {0x0b, 0x33, 0x31}, - {0x13, 0x33, 0x31}, - {0x1b, 0x33, 0x31}, - {0x03, 0x33, 0x31}, - {0x0b, 0x33, 0x31}, - {0x13, 0x33, 0x31}, - {0x1b, 0x33, 0x31}, - {0x03, 0x33, 0x31}, - {0x0b, 0x33, 0x31}, - {0x13, 0x33, 0x31}, - {0x06, 0x66, 0x61}, - {0x1d, 0x55, 0x51}, /* channel = 15, Tf = 4915MHz */ - {0x00, 0x00, 0x01}, - {0x02, 0xaa, 0xa1}, - {0x08, 0x00, 0x01}, - {0x0a, 0xaa, 0xa1}, - {0x0d, 0x55, 0x51}, - {0x15, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x1d, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x02, 0xaa, 0xa1}, - {0x08, 0x00, 0x01}, - {0x0a, 0xaa, 0xa1}, - {0x15, 0x55, 0x51}, - {0x05, 0x55, 0x51}, - {0x0a, 0xaa, 0xa1}, - {0x10, 0x00, 0x01}, - {0x15, 0x55, 0x51}, - {0x1a, 0xaa, 0xa1}, - {0x00, 0x00, 0x01}, - {0x05, 0x55, 0x51}, - {0x0a, 0xaa, 0xa1}, - {0x15, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x0a, 0xaa, 0xa1}, - {0x15, 0x55, 0x51}, - {0x15, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x0a, 0xaa, 0xa1}, - {0x15, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x0a, 0xaa, 0xa1}, - {0x15, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x0a, 0xaa, 0xa1}, - {0x15, 0x55, 0x51}, - {0x00, 0x00, 0x01}, - {0x18, 0x00, 0x01}, - {0x02, 0xaa, 0xa1}, - {0x0d, 0x55, 0x51}, - {0x18, 0x00, 0x01}, - {0x02, 0xaa, 0xb1} -}; - -static u8 al7230_channel_table2[CB_MAX_CHANNEL][3] = { - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, /* channel = 15 Tf = 4915MHz */ - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x6f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84}, - {0x7f, 0xd7, 0x84} -}; - static u8 vt3226_init_table[CB_VT3226_INIT_SEQ][3] = { {0x03, 0xff, 0x80}, {0x02, 0x82, 0xa1}, @@ -376,140 +161,6 @@ static const u32 vt3226d0_lo_current_table[CB_MAX_CHANNEL_24G] = { 0x0135c600 }; -static u8 vt3342a0_init_table[CB_VT3342_INIT_SEQ][3] = { /* 11b/g mode */ - {0x03, 0xff, 0x80}, - {0x02, 0x08, 0x81}, - {0x00, 0xc6, 0x02}, - {0x03, 0xc5, 0x13}, - {0x00, 0xee, 0xe4}, - {0x00, 0x71, 0xa5}, - {0x01, 0x75, 0x46}, - {0x01, 0x40, 0x27}, - {0x01, 0x54, 0x08}, - {0x00, 0x01, 0x69}, - {0x02, 0x00, 0xaa}, - {0x00, 0x08, 0xcb}, - {0x01, 0x70, 0x0c} -}; - -static u8 vt3342_channel_table0[CB_MAX_CHANNEL][3] = { - {0x02, 0x05, 0x03}, - {0x01, 0x15, 0x03}, - {0x03, 0xc5, 0x03}, - {0x02, 0x65, 0x03}, - {0x01, 0x15, 0x13}, - {0x03, 0xc5, 0x13}, - {0x02, 0x05, 0x13}, - {0x01, 0x15, 0x13}, - {0x03, 0xc5, 0x13}, - {0x02, 0x65, 0x13}, - {0x01, 0x15, 0x23}, - {0x03, 0xc5, 0x23}, - {0x02, 0x05, 0x23}, - {0x00, 0xd5, 0x23}, - {0x01, 0x15, 0x13}, /* channel = 15 Tf = 4915MHz */ - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x15, 0x13}, - {0x01, 0x55, 0x63}, - {0x01, 0x55, 0x63}, - {0x02, 0xa5, 0x63}, - {0x02, 0xa5, 0x63}, - {0x00, 0x05, 0x73}, - {0x00, 0x05, 0x73}, - {0x01, 0x55, 0x73}, - {0x02, 0xa5, 0x73}, - {0x00, 0x05, 0x83}, - {0x01, 0x55, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x02, 0xa5, 0x83}, - {0x00, 0x05, 0xF3}, - {0x01, 0x56, 0x03}, - {0x02, 0xa6, 0x03}, - {0x00, 0x06, 0x03}, - {0x00, 0x06, 0x03} -}; - -static u8 vt3342_channel_table1[CB_MAX_CHANNEL][3] = { - {0x01, 0x99, 0x94}, - {0x02, 0x44, 0x44}, - {0x02, 0xee, 0xe4}, - {0x03, 0x99, 0x94}, - {0x00, 0x44, 0x44}, - {0x00, 0xee, 0xe4}, - {0x01, 0x99, 0x94}, - {0x02, 0x44, 0x44}, - {0x02, 0xee, 0xe4}, - {0x03, 0x99, 0x94}, - {0x00, 0x44, 0x44}, - {0x00, 0xee, 0xe4}, - {0x01, 0x99, 0x94}, - {0x03, 0x33, 0x34}, - {0x00, 0x44, 0x44}, /* channel = 15 Tf = 4915MHz */ - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x00, 0x44, 0x44}, - {0x01, 0x55, 0x54}, - {0x01, 0x55, 0x54}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x00, 0x00, 0x04}, - {0x00, 0x00, 0x04}, - {0x01, 0x55, 0x54}, - {0x02, 0xaa, 0xa4}, - {0x00, 0x00, 0x04}, - {0x01, 0x55, 0x54}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x02, 0xaa, 0xa4}, - {0x03, 0x00, 0x04}, - {0x00, 0x55, 0x54}, - {0x01, 0xaa, 0xa4}, - {0x03, 0x00, 0x04}, - {0x03, 0x00, 0x04} -}; - enum { VNT_TABLE_INIT = 0, VNT_TABLE_INIT_2 = 0, @@ -528,10 +179,6 @@ static const struct vnt_table_info vnt_table_seq[][3] = { {&al2230_init_table[0][0], CB_AL2230_INIT_SEQ * 3}, {&al2230_channel_table0[0][0], CB_MAX_CHANNEL_24G * 3}, {&al2230_channel_table1[0][0], CB_MAX_CHANNEL_24G * 3} - }, { /* RF_AIROHA7230 init table, channel table 0 and 1 */ - {&al7230_init_table[0][0], CB_AL7230_INIT_SEQ * 3}, - {&al7230_channel_table0[0][0], CB_MAX_CHANNEL * 3}, - {&al7230_channel_table1[0][0], CB_MAX_CHANNEL * 3} }, { /* RF_VT3226 init table, channel table 0 and 1 */ {&vt3226_init_table[0][0], CB_VT3226_INIT_SEQ * 3}, {&vt3226_channel_table0[0][0], CB_MAX_CHANNEL_24G * 3}, @@ -540,14 +187,6 @@ static const struct vnt_table_info vnt_table_seq[][3] = { {&vt3226d0_init_table[0][0], CB_VT3226_INIT_SEQ * 3}, {&vt3226_channel_table0[0][0], CB_MAX_CHANNEL_24G * 3}, {&vt3226_channel_table1[0][0], CB_MAX_CHANNEL_24G * 3} - }, { /* RF_VT3342A0 init table, channel table 0 and 1 */ - {&vt3342a0_init_table[0][0], CB_VT3342_INIT_SEQ * 3}, - {&vt3342_channel_table0[0][0], CB_MAX_CHANNEL * 3}, - {&vt3342_channel_table1[0][0], CB_MAX_CHANNEL * 3} - }, { /* RF_AIROHA7230 init table 2 and channel table 2 */ - {&al7230_init_table_amode[0][0], CB_AL7230_INIT_SEQ * 3}, - {&al7230_channel_table2[0][0], CB_MAX_CHANNEL * 3}, - {NULL, 0} } }; @@ -641,24 +280,6 @@ static int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, break; - case RF_AIROHA7230: - if (ch->flags & IEEE80211_CHAN_NO_OFDM) - ret = vnt_rf_write_embedded(priv, 0x111bb900); - else - ret = vnt_rf_write_embedded(priv, 0x221bb900); - - if (ret) - return ret; - - /* - * 0x080F1B00 for 3 wire control TxGain(D10) - * and 0x31 as TX Gain value - */ - power_setting = 0x080c0b00 | (power << 12); - - ret = vnt_rf_write_embedded(priv, power_setting); - break; - case RF_VT3226: power_setting = ((0x3f - power) << 20) | (0x17 << 8); @@ -714,11 +335,6 @@ static int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, break; - case RF_VT3342A0: - power_setting = ((0x3f - power) << 20) | (0x27 << 8); - - ret = vnt_rf_write_embedded(priv, power_setting); - break; default: break; } @@ -766,10 +382,8 @@ void vnt_rf_rssi_to_dbm(struct vnt_private *priv, u8 rssi, long *dbm) switch (priv->rf_type) { case RF_AL2230: case RF_AL2230S: - case RF_AIROHA7230: case RF_VT3226: case RF_VT3226D0: - case RF_VT3342A0: a = airoharf[idx]; break; default: @@ -790,17 +404,11 @@ int vnt_rf_table_download(struct vnt_private *priv) case RF_AL2230S: idx = 0; break; - case RF_AIROHA7230: - idx = 1; - break; case RF_VT3226: - idx = 2; + idx = 1; break; case RF_VT3226D0: - idx = 3; - break; - case RF_VT3342A0: - idx = 4; + idx = 2; break; } @@ -831,23 +439,5 @@ int vnt_rf_table_download(struct vnt_private *priv) table_seq[VNT_TABLE_1].length, table_seq[VNT_TABLE_1].addr); - if (priv->rf_type == RF_AIROHA7230) { - table_seq = &vnt_table_seq[5][0]; - - /* Init Table 2 */ - ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT2, - table_seq[VNT_TABLE_INIT_2].length, - table_seq[VNT_TABLE_INIT_2].addr); - if (ret) - return ret; - - /* Channel Table 2 */ - ret = vnt_control_out_blocks(priv, VNT_REG_BLOCK_SIZE, - MESSAGE_REQUEST_RF_CH2, - table_seq[VNT_TABLE_2].length, - table_seq[VNT_TABLE_2].addr); - } - return ret; } diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index a31947f2620d..cd99091c6c28 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -58,8 +58,6 @@ static struct vnt_usb_send_context struct vnt_usb_send_context *context = NULL; int ii; - dev_dbg(&priv->usb->dev, "%s\n", __func__); - for (ii = 0; ii < priv->num_tx_context; ii++) { if (!priv->tx_context[ii]) return NULL; @@ -355,10 +353,8 @@ static bool vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb) ether_addr_copy(mic_hdr->addr2, hdr->addr2); ether_addr_copy(mic_hdr->addr3, hdr->addr3); - mic_hdr->frame_control = cpu_to_le16( - le16_to_cpu(hdr->frame_control) & 0xc78f); - mic_hdr->seq_ctrl = cpu_to_le16( - le16_to_cpu(hdr->seq_ctrl) & 0xf); + mic_hdr->frame_control = cpu_to_le16(le16_to_cpu(hdr->frame_control) & 0xc78f); + mic_hdr->seq_ctrl = cpu_to_le16(le16_to_cpu(hdr->seq_ctrl) & 0xf); if (ieee80211_has_a4(hdr->frame_control)) ether_addr_copy(mic_hdr->addr4, hdr->addr4); @@ -703,7 +699,7 @@ int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif) { struct sk_buff *beacon; - beacon = ieee80211_beacon_get(priv->hw, vif); + beacon = ieee80211_beacon_get(priv->hw, vif, 0); if (!beacon) return -ENOMEM; diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 7f45734390f6..d505b4b69ba4 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -230,7 +230,9 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb) else vnt_int_process_data(priv); - status = usb_submit_urb(priv->interrupt_urb, GFP_ATOMIC); + if (!test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) + status = usb_submit_urb(priv->interrupt_urb, GFP_ATOMIC); + if (status) dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", status); } diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index e8ee2fbee76c..14b8aa587119 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -31,6 +31,15 @@ static void vnt_cmd_timer_wait(struct vnt_private *priv, unsigned long msecs) schedule_delayed_work(&priv->run_command_work, msecs_to_jiffies(msecs)); } +static u32 add_one_with_wrap_around(u32 var, u8 modulo) +{ + if (var >= (modulo - 1)) + var = 0; + else + var++; + return var; +} + static int vnt_cmd_complete(struct vnt_private *priv) { priv->command_state = WLAN_CMD_IDLE; @@ -42,7 +51,7 @@ static int vnt_cmd_complete(struct vnt_private *priv) priv->command = priv->cmd_queue[priv->cmd_dequeue_idx]; - ADD_ONE_WITH_WRAP_AROUND(priv->cmd_dequeue_idx, CMD_Q_SIZE); + priv->cmd_dequeue_idx = add_one_with_wrap_around(priv->cmd_dequeue_idx, CMD_Q_SIZE); priv->free_cmd_queue++; priv->cmd_running = true; @@ -157,7 +166,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command) priv->cmd_queue[priv->cmd_enqueue_idx] = command; - ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE); + priv->cmd_enqueue_idx = add_one_with_wrap_around(priv->cmd_enqueue_idx, CMD_Q_SIZE); priv->free_cmd_queue--; if (!priv->cmd_running) |