aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>2009-10-13 05:47:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:10 -0400
commit1ebec3d750f2b5740e3c334dac06104d2f74a9b1 (patch)
tree2592f80a0eb959ae0ba230e008272d50d69b2d45 /drivers/net/wireless/wl12xx/wl1271_main.c
parentc6d5d06e455b9965e300ae40c34fa2337e1aad0f (diff)
wl1271: Added 5 GHz parameters for wl1273
Added data rate and frequency tables for 5 GHz band channels, 5 GHz radio configration parameters and configuration option to enable 802.11 support. Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c123
1 files changed, 107 insertions, 16 deletions
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 */
1566static 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 */
1594static 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
1640static 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
1559static const struct ieee80211_ops wl1271_ops = { 1647static 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;