aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/p54/p54.h1
-rw-r--r--drivers/net/wireless/p54/p54common.c23
2 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index 1d0704fe146f..8da4d3020599 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -81,6 +81,7 @@ struct p54_common {
81 unsigned int output_limit_len; 81 unsigned int output_limit_len;
82 struct pda_pa_curve_data *curve_data; 82 struct pda_pa_curve_data *curve_data;
83 unsigned int filter_flags; 83 unsigned int filter_flags;
84 bool use_short_slot;
84 u16 rxhw; 85 u16 rxhw;
85 u8 version; 86 u8 version;
86 u8 rx_antenna; 87 u8 rx_antenna;
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 6370c44c64d5..b1dc10ccd32c 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -901,12 +901,10 @@ static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type,
901 memset(filter->bssid, ~0, ETH_ALEN); 901 memset(filter->bssid, ~0, ETH_ALEN);
902 else 902 else
903 memcpy(filter->bssid, bssid, ETH_ALEN); 903 memcpy(filter->bssid, bssid, ETH_ALEN);
904
905 filter->rx_antenna = priv->rx_antenna; 904 filter->rx_antenna = priv->rx_antenna;
906
907 if (priv->fw_var < 0x500) { 905 if (priv->fw_var < 0x500) {
908 data_len = P54_TX_CONTROL_FILTER_V1_LEN; 906 data_len = P54_TX_CONTROL_FILTER_V1_LEN;
909 filter->v1.basic_rate_mask = cpu_to_le32(0x15F); 907 filter->v1.basic_rate_mask = cpu_to_le32(0x15f);
910 filter->v1.rx_addr = cpu_to_le32(priv->rx_end); 908 filter->v1.rx_addr = cpu_to_le32(priv->rx_end);
911 filter->v1.max_rx = cpu_to_le16(priv->rx_mtu); 909 filter->v1.max_rx = cpu_to_le16(priv->rx_mtu);
912 filter->v1.rxhw = cpu_to_le16(priv->rxhw); 910 filter->v1.rxhw = cpu_to_le16(priv->rxhw);
@@ -918,7 +916,6 @@ static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type,
918 filter->v2.rxhw = cpu_to_le16(priv->rxhw); 916 filter->v2.rxhw = cpu_to_le16(priv->rxhw);
919 filter->v2.timer = cpu_to_le16(1000); 917 filter->v2.timer = cpu_to_le16(1000);
920 } 918 }
921
922 hdr->len = cpu_to_le16(data_len); 919 hdr->len = cpu_to_le16(data_len);
923 p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + data_len); 920 p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + data_len);
924 priv->tx(dev, hdr, sizeof(*hdr) + data_len, 1); 921 priv->tx(dev, hdr, sizeof(*hdr) + data_len, 1);
@@ -1088,7 +1085,7 @@ static void p54_set_vdcf(struct ieee80211_hw *dev)
1088 1085
1089 vdcf = (struct p54_tx_control_vdcf *) hdr->data; 1086 vdcf = (struct p54_tx_control_vdcf *) hdr->data;
1090 1087
1091 if (dev->conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME) { 1088 if (priv->use_short_slot) {
1092 vdcf->slottime = 9; 1089 vdcf->slottime = 9;
1093 vdcf->magic1 = 0x10; 1090 vdcf->magic1 = 0x10;
1094 vdcf->magic2 = 0x00; 1091 vdcf->magic2 = 0x00;
@@ -1135,7 +1132,6 @@ static int p54_start(struct ieee80211_hw *dev)
1135 priv->mode = NL80211_IFTYPE_MONITOR; 1132 priv->mode = NL80211_IFTYPE_MONITOR;
1136 1133
1137 p54_init_vdcf(dev); 1134 p54_init_vdcf(dev);
1138
1139 mod_timer(&priv->stats_timer, jiffies + HZ); 1135 mod_timer(&priv->stats_timer, jiffies + HZ);
1140 return err; 1136 return err;
1141} 1137}
@@ -1351,6 +1347,19 @@ static int p54_get_tx_stats(struct ieee80211_hw *dev,
1351 return 0; 1347 return 0;
1352} 1348}
1353 1349
1350static void p54_bss_info_changed(struct ieee80211_hw *dev,
1351 struct ieee80211_vif *vif,
1352 struct ieee80211_bss_conf *info,
1353 u32 changed)
1354{
1355 struct p54_common *priv = dev->priv;
1356
1357 if (changed & BSS_CHANGED_ERP_SLOT) {
1358 priv->use_short_slot = info->use_short_slot;
1359 p54_set_vdcf(dev);
1360 }
1361}
1362
1354static const struct ieee80211_ops p54_ops = { 1363static const struct ieee80211_ops p54_ops = {
1355 .tx = p54_tx, 1364 .tx = p54_tx,
1356 .start = p54_start, 1365 .start = p54_start,
@@ -1359,6 +1368,7 @@ static const struct ieee80211_ops p54_ops = {
1359 .remove_interface = p54_remove_interface, 1368 .remove_interface = p54_remove_interface,
1360 .config = p54_config, 1369 .config = p54_config,
1361 .config_interface = p54_config_interface, 1370 .config_interface = p54_config_interface,
1371 .bss_info_changed = p54_bss_info_changed,
1362 .configure_filter = p54_configure_filter, 1372 .configure_filter = p54_configure_filter,
1363 .conf_tx = p54_conf_tx, 1373 .conf_tx = p54_conf_tx,
1364 .get_stats = p54_get_stats, 1374 .get_stats = p54_get_stats,
@@ -1385,7 +1395,6 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
1385 dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); 1395 dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
1386 1396
1387 dev->channel_change_time = 1000; /* TODO: find actual value */ 1397 dev->channel_change_time = 1000; /* TODO: find actual value */
1388
1389 priv->tx_stats[0].limit = 1; 1398 priv->tx_stats[0].limit = 1;
1390 priv->tx_stats[1].limit = 1; 1399 priv->tx_stats[1].limit = 1;
1391 priv->tx_stats[2].limit = 1; 1400 priv->tx_stats[2].limit = 1;