diff options
Diffstat (limited to 'drivers/net/wireless/wl1251')
29 files changed, 10680 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl1251/Kconfig b/drivers/net/wireless/wl1251/Kconfig new file mode 100644 index 00000000000..1fb65849414 --- /dev/null +++ b/drivers/net/wireless/wl1251/Kconfig | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | menuconfig WL1251 | ||
| 2 | tristate "TI wl1251 driver support" | ||
| 3 | depends on MAC80211 && EXPERIMENTAL && GENERIC_HARDIRQS | ||
| 4 | select FW_LOADER | ||
| 5 | select CRC7 | ||
| 6 | ---help--- | ||
| 7 | This will enable TI wl1251 driver support. The drivers make | ||
| 8 | use of the mac80211 stack. | ||
| 9 | |||
| 10 | If you choose to build a module, it'll be called wl1251. Say | ||
| 11 | N if unsure. | ||
| 12 | |||
| 13 | config WL1251_SPI | ||
| 14 | tristate "TI wl1251 SPI support" | ||
| 15 | depends on WL1251 && SPI_MASTER | ||
| 16 | ---help--- | ||
| 17 | This module adds support for the SPI interface of adapters using | ||
| 18 | TI wl1251 chipset. Select this if your platform is using | ||
| 19 | the SPI bus. | ||
| 20 | |||
| 21 | If you choose to build a module, it'll be called wl1251_spi. | ||
| 22 | Say N if unsure. | ||
| 23 | |||
| 24 | config WL1251_SDIO | ||
| 25 | tristate "TI wl1251 SDIO support" | ||
| 26 | depends on WL1251 && MMC | ||
| 27 | ---help--- | ||
| 28 | This module adds support for the SDIO interface of adapters using | ||
| 29 | TI wl1251 chipset. Select this if your platform is using | ||
| 30 | the SDIO bus. | ||
| 31 | |||
| 32 | If you choose to build a module, it'll be called | ||
| 33 | wl1251_sdio. Say N if unsure. | ||
diff --git a/drivers/net/wireless/wl1251/Makefile b/drivers/net/wireless/wl1251/Makefile new file mode 100644 index 00000000000..58b4f935a3f --- /dev/null +++ b/drivers/net/wireless/wl1251/Makefile | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | wl1251-objs = main.o event.o tx.o rx.o ps.o cmd.o \ | ||
| 2 | acx.o boot.o init.o debugfs.o io.o | ||
| 3 | wl1251_spi-objs += spi.o | ||
| 4 | wl1251_sdio-objs += sdio.o | ||
| 5 | |||
| 6 | obj-$(CONFIG_WL1251) += wl1251.o | ||
| 7 | obj-$(CONFIG_WL1251_SPI) += wl1251_spi.o | ||
| 8 | obj-$(CONFIG_WL1251_SDIO) += wl1251_sdio.o | ||
diff --git a/drivers/net/wireless/wl1251/acx.c b/drivers/net/wireless/wl1251/acx.c new file mode 100644 index 00000000000..ad87a1ac646 --- /dev/null +++ b/drivers/net/wireless/wl1251/acx.c | |||
| @@ -0,0 +1,1097 @@ | |||
| 1 | #include "acx.h" | ||
| 2 | |||
| 3 | #include <linux/module.h> | ||
| 4 | #include <linux/slab.h> | ||
| 5 | #include <linux/crc7.h> | ||
| 6 | |||
| 7 | #include "wl1251.h" | ||
| 8 | #include "reg.h" | ||
| 9 | #include "cmd.h" | ||
| 10 | #include "ps.h" | ||
| 11 | |||
| 12 | int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod, | ||
| 13 | u8 mgt_rate, u8 mgt_mod) | ||
| 14 | { | ||
| 15 | struct acx_fw_gen_frame_rates *rates; | ||
| 16 | int ret; | ||
| 17 | |||
| 18 | wl1251_debug(DEBUG_ACX, "acx frame rates"); | ||
| 19 | |||
| 20 | rates = kzalloc(sizeof(*rates), GFP_KERNEL); | ||
| 21 | if (!rates) { | ||
| 22 | ret = -ENOMEM; | ||
| 23 | goto out; | ||
| 24 | } | ||
| 25 | |||
| 26 | rates->tx_ctrl_frame_rate = ctrl_rate; | ||
| 27 | rates->tx_ctrl_frame_mod = ctrl_mod; | ||
| 28 | rates->tx_mgt_frame_rate = mgt_rate; | ||
| 29 | rates->tx_mgt_frame_mod = mgt_mod; | ||
| 30 | |||
| 31 | ret = wl1251_cmd_configure(wl, ACX_FW_GEN_FRAME_RATES, | ||
| 32 | rates, sizeof(*rates)); | ||
| 33 | if (ret < 0) { | ||
| 34 | wl1251_error("Failed to set FW rates and modulation"); | ||
| 35 | goto out; | ||
| 36 | } | ||
| 37 | |||
| 38 | out: | ||
| 39 | kfree(rates); | ||
| 40 | return ret; | ||
| 41 | } | ||
| 42 | |||
| 43 | |||
| 44 | int wl1251_acx_station_id(struct wl1251 *wl) | ||
| 45 | { | ||
| 46 | struct acx_dot11_station_id *mac; | ||
| 47 | int ret, i; | ||
| 48 | |||
| 49 | wl1251_debug(DEBUG_ACX, "acx dot11_station_id"); | ||
| 50 | |||
| 51 | mac = kzalloc(sizeof(*mac), GFP_KERNEL); | ||
| 52 | if (!mac) { | ||
| 53 | ret = -ENOMEM; | ||
| 54 | goto out; | ||
| 55 | } | ||
| 56 | |||
| 57 | for (i = 0; i < ETH_ALEN; i++) | ||
| 58 | mac->mac[i] = wl->mac_addr[ETH_ALEN - 1 - i]; | ||
| 59 | |||
| 60 | ret = wl1251_cmd_configure(wl, DOT11_STATION_ID, mac, sizeof(*mac)); | ||
| 61 | if (ret < 0) | ||
| 62 | goto out; | ||
| 63 | |||
| 64 | out: | ||
| 65 | kfree(mac); | ||
| 66 | return ret; | ||
| 67 | } | ||
| 68 | |||
| 69 | int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id) | ||
| 70 | { | ||
| 71 | struct acx_dot11_default_key *default_key; | ||
| 72 | int ret; | ||
| 73 | |||
| 74 | wl1251_debug(DEBUG_ACX, "acx dot11_default_key (%d)", key_id); | ||
| 75 | |||
| 76 | default_key = kzalloc(sizeof(*default_key), GFP_KERNEL); | ||
| 77 | if (!default_key) { | ||
| 78 | ret = -ENOMEM; | ||
| 79 | goto out; | ||
| 80 | } | ||
| 81 | |||
| 82 | default_key->id = key_id; | ||
| 83 | |||
| 84 | ret = wl1251_cmd_configure(wl, DOT11_DEFAULT_KEY, | ||
| 85 | default_key, sizeof(*default_key)); | ||
| 86 | if (ret < 0) { | ||
| 87 | wl1251_error("Couldn't set default key"); | ||
| 88 | goto out; | ||
| 89 | } | ||
| 90 | |||
| 91 | wl->default_key = key_id; | ||
| 92 | |||
| 93 | out: | ||
| 94 | kfree(default_key); | ||
| 95 | return ret; | ||
| 96 | } | ||
| 97 | |||
| 98 | int wl1251_acx_wake_up_conditions(struct wl1251 *wl, u8 wake_up_event, | ||
| 99 | u8 listen_interval) | ||
| 100 | { | ||
| 101 | struct acx_wake_up_condition *wake_up; | ||
| 102 | int ret; | ||
| 103 | |||
| 104 | wl1251_debug(DEBUG_ACX, "acx wake up conditions"); | ||
| 105 | |||
| 106 | wake_up = kzalloc(sizeof(*wake_up), GFP_KERNEL); | ||
| 107 | if (!wake_up) { | ||
| 108 | ret = -ENOMEM; | ||
| 109 | goto out; | ||
| 110 | } | ||
| 111 | |||
| 112 | wake_up->wake_up_event = wake_up_event; | ||
| 113 | wake_up->listen_interval = listen_interval; | ||
| 114 | |||
| 115 | ret = wl1251_cmd_configure(wl, ACX_WAKE_UP_CONDITIONS, | ||
| 116 | wake_up, sizeof(*wake_up)); | ||
| 117 | if (ret < 0) { | ||
| 118 | wl1251_warning("could not set wake up conditions: %d", ret); | ||
| 119 | goto out; | ||
| 120 | } | ||
| 121 | |||
| 122 | out: | ||
| 123 | kfree(wake_up); | ||
| 124 | return ret; | ||
| 125 | } | ||
| 126 | |||
| 127 | int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth) | ||
| 128 | { | ||
| 129 | struct acx_sleep_auth *auth; | ||
| 130 | int ret; | ||
| 131 | |||
| 132 | wl1251_d | ||
