diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_conf.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 123 |
3 files changed, 127 insertions, 17 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index e0ebb1fb2ada..dc9957ee1ac3 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h | |||
@@ -113,6 +113,11 @@ enum { | |||
113 | #define WL1271_NVS_NAME "wl1271-nvs.bin" | 113 | #define WL1271_NVS_NAME "wl1271-nvs.bin" |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Enable/disable 802.11a support for WL1273 | ||
117 | */ | ||
118 | #undef WL1271_80211A_ENABLED | ||
119 | |||
120 | /* | ||
116 | * FIXME: for the wl1271, a busy word count of 1 here will result in a more | 121 | * FIXME: for the wl1271, a busy word count of 1 here will result in a more |
117 | * optimal SPI interface. There is some SPI bug however, causing RXS time outs | 122 | * optimal SPI interface. There is some SPI bug however, causing RXS time outs |
118 | * with this mode occasionally on boot, so lets have three for now. A value of | 123 | * with this mode occasionally on boot, so lets have three for now. A value of |
@@ -442,4 +447,13 @@ int wl1271_plt_stop(struct wl1271 *wl); | |||
442 | /* WL1271 needs a 200ms sleep after power on */ | 447 | /* WL1271 needs a 200ms sleep after power on */ |
443 | #define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */ | 448 | #define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */ |
444 | 449 | ||
450 | static inline bool wl1271_11a_enabled(void) | ||
451 | { | ||
452 | #ifdef WL1271_80211A_ENABLED | ||
453 | return true; | ||
454 | #else | ||
455 | return false; | ||
456 | #endif | ||
457 | } | ||
458 | |||
445 | #endif | 459 | #endif |
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h index 00ffa6679324..061d47520a32 100644 --- a/drivers/net/wireless/wl12xx/wl1271_conf.h +++ b/drivers/net/wireless/wl12xx/wl1271_conf.h | |||
@@ -746,6 +746,11 @@ enum { | |||
746 | CONF_REF_CLK_52_E | 746 | CONF_REF_CLK_52_E |
747 | }; | 747 | }; |
748 | 748 | ||
749 | enum single_dual_band_enum { | ||
750 | CONF_SINGLE_BAND, | ||
751 | CONF_DUAL_BAND | ||
752 | }; | ||
753 | |||
749 | struct conf_general_parms { | 754 | struct conf_general_parms { |
750 | /* | 755 | /* |
751 | * RF Reference Clock type / speed | 756 | * RF Reference Clock type / speed |
@@ -778,7 +783,7 @@ struct conf_general_parms { | |||
778 | /* | 783 | /* |
779 | * Flag defining whether used as single or dual-band. | 784 | * Flag defining whether used as single or dual-band. |
780 | * | 785 | * |
781 | * Range: Unknown | 786 | * Range: CONF_SINGLE_BAND, CONF_DUAL_BAND |
782 | */ | 787 | */ |
783 | u8 single_dual_band; | 788 | u8 single_dual_band; |
784 | 789 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 3d2e999ef15a..9b1cc8db1ddd 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -260,13 +260,12 @@ static struct conf_drv_settings default_conf = { | |||
260 | .settling_time = 5, | 260 | .settling_time = 5, |
261 | .clk_valid_on_wakeup = 0, | 261 | .clk_valid_on_wakeup = 0, |
262 | .dc2dcmode = 0, | 262 | .dc2dcmode = 0, |
263 | .single_dual_band = 0, | 263 | .single_dual_band = CONF_SINGLE_BAND, |
264 | .tx_bip_fem_autodetect = 0, | 264 | .tx_bip_fem_autodetect = 0, |
265 | .tx_bip_fem_manufacturer = 1, | 265 | .tx_bip_fem_manufacturer = 1, |
266 | .settings = 1, | 266 | .settings = 1, |
267 | }, | 267 | }, |
268 | .radioparam = { | 268 | .radioparam = { |
269 | /* FIXME: 5GHz values unset! */ | ||
270 | .rx_trace_loss = 10, | 269 | .rx_trace_loss = 10, |
271 | .tx_trace_loss = 10, | 270 | .tx_trace_loss = 10, |
272 | .rx_rssi_and_proc_compens = { | 271 | .rx_rssi_and_proc_compens = { |
@@ -299,25 +298,29 @@ static struct conf_drv_settings default_conf = { | |||
299 | .tx_ibias = { | 298 | .tx_ibias = { |
300 | 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 }, | 299 | 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 }, |
301 | .rx_fem_insertion_loss = 0x14, | 300 | .rx_fem_insertion_loss = 0x14, |
302 | .tx_ref_pd_voltage_5 = { 0, 0, 0, 0, 0, 0, 0 }, | 301 | .tx_ref_pd_voltage_5 = { |
303 | .tx_ref_power_5 = { 0, 0, 0, 0, 0, 0, 0 }, | 302 | 0x0190, 0x01a4, 0x01c3, 0x01d8, |
304 | .tx_offset_db_5 = {0, 0, 0, 0, 0, 0, 0 }, | 303 | 0x020a, 0x021c }, |
305 | .tx_rate_limits_normal_5 = { | 304 | .tx_ref_power_5 = { |
305 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, | ||
306 | .tx_offset_db_5 = { | ||
306 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | 307 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, |
308 | .tx_rate_limits_normal_5 = { | ||
309 | 0x1b, 0x1e, 0x21, 0x23, 0x27, 0x00 }, | ||
307 | .tx_rate_limits_degraded_5 = { | 310 | .tx_rate_limits_degraded_5 = { |
308 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | 311 | 0x1b, 0x1e, 0x21, 0x23, 0x27, 0x00 }, |
309 | .tx_channel_limits_ofdm_5 = { | 312 | .tx_channel_limits_ofdm_5 = { |
310 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 313 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, |
311 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 314 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, |
312 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 315 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, |
313 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 316 | 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, |
314 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 317 | 0x50, 0x50, 0x50 }, |
315 | 0x00, 0x00, 0x00, 0x00, 0x00}, | ||
316 | .tx_pdv_rate_offsets_5 = { | 318 | .tx_pdv_rate_offsets_5 = { |
317 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | 319 | 0x01, 0x02, 0x02, 0x02, 0x02, 0x00 }, |
318 | .tx_ibias_5 = { | 320 | .tx_ibias_5 = { |
319 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | 321 | 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, |
320 | .rx_fem_insertion_loss_5 = { 0, 0, 0, 0, 0, 0, 0 } | 322 | .rx_fem_insertion_loss_5 = { |
323 | 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 } | ||
321 | } | 324 | } |
322 | } | 325 | } |
323 | }; | 326 | }; |
@@ -337,6 +340,9 @@ static void wl1271_conf_init(struct wl1271 *wl) | |||
337 | 340 | ||
338 | /* apply driver default configuration */ | 341 | /* apply driver default configuration */ |
339 | memcpy(&wl->conf, &default_conf, sizeof(default_conf)); | 342 | memcpy(&wl->conf, &default_conf, sizeof(default_conf)); |
343 | |||
344 | if (wl1271_11a_enabled()) | ||
345 | wl->conf.init.genparam.single_dual_band = CONF_DUAL_BAND; | ||
340 | } | 346 | } |
341 | 347 | ||
342 | 348 | ||
@@ -1556,6 +1562,88 @@ static struct ieee80211_supported_band wl1271_band_2ghz = { | |||
1556 | .n_bitrates = ARRAY_SIZE(wl1271_rates), | 1562 | .n_bitrates = ARRAY_SIZE(wl1271_rates), |
1557 | }; | 1563 | }; |
1558 | 1564 | ||
1565 | /* 5 GHz data rates for WL1273 */ | ||
1566 | static struct ieee80211_rate wl1271_rates_5ghz[] = { | ||
1567 | { .bitrate = 60, | ||
1568 | .hw_value = CONF_HW_BIT_RATE_6MBPS, | ||
1569 | .hw_value_short = CONF_HW_BIT_RATE_6MBPS, }, | ||
1570 | { .bitrate = 90, | ||
1571 | .hw_value = CONF_HW_BIT_RATE_9MBPS, | ||
1572 | .hw_value_short = CONF_HW_BIT_RATE_9MBPS, }, | ||
1573 | { .bitrate = 120, | ||
1574 | .hw_value = CONF_HW_BIT_RATE_12MBPS, | ||
1575 | .hw_value_short = CONF_HW_BIT_RATE_12MBPS, }, | ||
1576 | { .bitrate = 180, | ||
1577 | .hw_value = CONF_HW_BIT_RATE_18MBPS, | ||
1578 | .hw_value_short = CONF_HW_BIT_RATE_18MBPS, }, | ||
1579 | { .bitrate = 240, | ||
1580 | .hw_value = CONF_HW_BIT_RATE_24MBPS, | ||
1581 | .hw_value_short = CONF_HW_BIT_RATE_24MBPS, }, | ||
1582 | { .bitrate = 360, | ||
1583 | .hw_value = CONF_HW_BIT_RATE_36MBPS, | ||
1584 | .hw_value_short = CONF_HW_BIT_RATE_36MBPS, }, | ||
1585 | { .bitrate = 480, | ||
1586 | .hw_value = CONF_HW_BIT_RATE_48MBPS, | ||
1587 | .hw_value_short = CONF_HW_BIT_RATE_48MBPS, }, | ||
1588 | { .bitrate = 540, | ||
1589 | .hw_value = CONF_HW_BIT_RATE_54MBPS, | ||
1590 | .hw_value_short = CONF_HW_BIT_RATE_54MBPS, }, | ||
1591 | }; | ||
1592 | |||
1593 | /* 5 GHz band channels for WL1273 */ | ||
1594 | static struct ieee80211_channel wl1271_channels_5ghz[] = { | ||
1595 | { .hw_value = 183, .center_freq = 4915}, | ||
1596 | { .hw_value = 184, .center_freq = 4920}, | ||
1597 | { .hw_value = 185, .center_freq = 4925}, | ||
1598 | { .hw_value = 187, .center_freq = 4935}, | ||
1599 | { .hw_value = 188, .center_freq = 4940}, | ||
1600 | { .hw_value = 189, .center_freq = 4945}, | ||
1601 | { .hw_value = 192, .center_freq = 4960}, | ||
1602 | { .hw_value = 196, .center_freq = 4980}, | ||
1603 | { .hw_value = 7, .center_freq = 5035}, | ||
1604 | { .hw_value = 8, .center_freq = 5040}, | ||
1605 | { .hw_value = 9, .center_freq = 5045}, | ||
1606 | { .hw_value = 11, .center_freq = 5055}, | ||
1607 | { .hw_value = 12, .center_freq = 5060}, | ||
1608 | { .hw_value = 16, .center_freq = 5080}, | ||
1609 | { .hw_value = 34, .center_freq = 5170}, | ||
1610 | { .hw_value = 36, .center_freq = 5180}, | ||
1611 | { .hw_value = 38, .center_freq = 5190}, | ||
1612 | { .hw_value = 40, .center_freq = 5200}, | ||
1613 | { .hw_value = 42, .center_freq = 5210}, | ||
1614 | { .hw_value = 44, .center_freq = 5220}, | ||
1615 | { .hw_value = 46, .center_freq = 5230}, | ||
1616 | { .hw_value = 48, .center_freq = 5240}, | ||
1617 | { .hw_value = 52, .center_freq = 5260}, | ||
1618 | { .hw_value = 56, .center_freq = 5280}, | ||
1619 | { .hw_value = 60, .center_freq = 5300}, | ||
1620 | { .hw_value = 64, .center_freq = 5320}, | ||
1621 | { .hw_value = 100, .center_freq = 5500}, | ||
1622 | { .hw_value = 104, .center_freq = 5520}, | ||
1623 | { .hw_value = 108, .center_freq = 5540}, | ||
1624 | { .hw_value = 112, .center_freq = 5560}, | ||
1625 | { .hw_value = 116, .center_freq = 5580}, | ||
1626 | { .hw_value = 120, .center_freq = 5600}, | ||
1627 | { .hw_value = 124, .center_freq = 5620}, | ||
1628 | { .hw_value = 128, .center_freq = 5640}, | ||
1629 | { .hw_value = 132, .center_freq = 5660}, | ||
1630 | { .hw_value = 136, .center_freq = 5680}, | ||
1631 | { .hw_value = 140, .center_freq = 5700}, | ||
1632 | { .hw_value = 149, .center_freq = 5745}, | ||
1633 | { .hw_value = 153, .center_freq = 5765}, | ||
1634 | { .hw_value = 157, .center_freq = 5785}, | ||
1635 | { .hw_value = 161, .center_freq = 5805}, | ||
1636 | { .hw_value = 165, .center_freq = 5825}, | ||
1637 | }; | ||
1638 | |||
1639 | |||
1640 | static struct ieee80211_supported_band wl1271_band_5ghz = { | ||
1641 | .channels = wl1271_channels_5ghz, | ||
1642 | .n_channels = ARRAY_SIZE(wl1271_channels_5ghz), | ||
1643 | .bitrates = wl1271_rates_5ghz, | ||
1644 | .n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz), | ||
1645 | }; | ||
1646 | |||
1559 | static const struct ieee80211_ops wl1271_ops = { | 1647 | static const struct ieee80211_ops wl1271_ops = { |
1560 | .start = wl1271_op_start, | 1648 | .start = wl1271_op_start, |
1561 | .stop = wl1271_op_stop, | 1649 | .stop = wl1271_op_stop, |
@@ -1612,6 +1700,9 @@ static int wl1271_init_ieee80211(struct wl1271 *wl) | |||
1612 | wl->hw->wiphy->max_scan_ssids = 1; | 1700 | wl->hw->wiphy->max_scan_ssids = 1; |
1613 | wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz; | 1701 | wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz; |
1614 | 1702 | ||
1703 | if (wl1271_11a_enabled()) | ||
1704 | wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz; | ||
1705 | |||
1615 | SET_IEEE80211_DEV(wl->hw, &wl->spi->dev); | 1706 | SET_IEEE80211_DEV(wl->hw, &wl->spi->dev); |
1616 | 1707 | ||
1617 | return 0; | 1708 | return 0; |