aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-10-22 14:21:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-11-06 16:54:41 -0500
commit6f6d1e9a8a7fea5e4400cad64bed717e322208e1 (patch)
tree026788640e47d7a130ac206f9466148c01d56023 /drivers/net/wireless
parent2e484c8964f7845d320eb1161c514dbfcafdda78 (diff)
mwl8k: add support for the 88w8366
Add support for the 88w8366 firmware receive descriptor format, and add the 88w8366 PCI ID. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mwl8k.c95
1 files changed, 94 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index de38ec481f60..9fde17bb9911 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -756,7 +756,89 @@ static inline void mwl8k_add_dma_header(struct sk_buff *skb)
756 756
757 757
758/* 758/*
759 * Packet reception. 759 * Packet reception for 88w8366.
760 */
761struct mwl8k_rxd_8366 {
762 __le16 pkt_len;
763 __u8 sq2;
764 __u8 rate;
765 __le32 pkt_phys_addr;
766 __le32 next_rxd_phys_addr;
767 __le16 qos_control;
768 __le16 htsig2;
769 __le32 hw_rssi_info;
770 __le32 hw_noise_floor_info;
771 __u8 noise_floor;
772 __u8 pad0[3];
773 __u8 rssi;
774 __u8 rx_status;
775 __u8 channel;
776 __u8 rx_ctrl;
777} __attribute__((packed));
778
779#define MWL8K_8366_RX_CTRL_OWNED_BY_HOST 0x80
780
781static void mwl8k_rxd_8366_init(void *_rxd, dma_addr_t next_dma_addr)
782{
783 struct mwl8k_rxd_8366 *rxd = _rxd;
784
785 rxd->next_rxd_phys_addr = cpu_to_le32(next_dma_addr);
786 rxd->rx_ctrl = MWL8K_8366_RX_CTRL_OWNED_BY_HOST;
787}
788
789static void mwl8k_rxd_8366_refill(void *_rxd, dma_addr_t addr, int len)
790{
791 struct mwl8k_rxd_8366 *rxd = _rxd;
792
793 rxd->pkt_len = cpu_to_le16(len);
794 rxd->pkt_phys_addr = cpu_to_le32(addr);
795 wmb();
796 rxd->rx_ctrl = 0;
797}
798
799static int
800mwl8k_rxd_8366_process(void *_rxd, struct ieee80211_rx_status *status)
801{
802 struct mwl8k_rxd_8366 *rxd = _rxd;
803
804 if (!(rxd->rx_ctrl & MWL8K_8366_RX_CTRL_OWNED_BY_HOST))
805 return -1;
806 rmb();
807
808 memset(status, 0, sizeof(*status));
809
810 status->signal = -rxd->rssi;
811 status->noise = -rxd->noise_floor;
812
813 if (rxd->rate & 0x80) {
814 status->flag |= RX_FLAG_HT;
815 status->rate_idx = rxd->rate & 0x7f;
816 } else {
817 int i;
818
819 for (i = 0; i < ARRAY_SIZE(mwl8k_rates); i++) {
820 if (mwl8k_rates[i].hw_value == rxd->rate) {
821 status->rate_idx = i;
822 break;
823 }
824 }
825 }
826
827 status->band = IEEE80211_BAND_2GHZ;
828 status->freq = ieee80211_channel_to_frequency(rxd->channel);
829
830 return le16_to_cpu(rxd->pkt_len);
831}
832
833static struct rxd_ops rxd_8366_ops = {
834 .rxd_size = sizeof(struct mwl8k_rxd_8366),
835 .rxd_init = mwl8k_rxd_8366_init,
836 .rxd_refill = mwl8k_rxd_8366_refill,
837 .rxd_process = mwl8k_rxd_8366_process,
838};
839
840/*
841 * Packet reception for 88w8687.
760 */ 842 */
761struct mwl8k_rxd_8687 { 843struct mwl8k_rxd_8687 {
762 __le16 pkt_len; 844 __le16 pkt_len;
@@ -3226,6 +3308,14 @@ static void mwl8k_finalize_join_worker(struct work_struct *work)
3226 priv->beacon_skb = NULL; 3308 priv->beacon_skb = NULL;
3227} 3309}
3228 3310
3311static struct mwl8k_device_info di_8366 = {
3312 .part_name = "88w8366",
3313 .helper_image = "mwl8k/helper_8366.fw",
3314 .fw_image = "mwl8k/fmimage_8366.fw",
3315 .rxd_ops = &rxd_8366_ops,
3316 .modes = 0,
3317};
3318
3229static struct mwl8k_device_info di_8687 = { 3319static struct mwl8k_device_info di_8687 = {
3230 .part_name = "88w8687", 3320 .part_name = "88w8687",
3231 .helper_image = "mwl8k/helper_8687.fw", 3321 .helper_image = "mwl8k/helper_8687.fw",
@@ -3242,6 +3332,9 @@ static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
3242 PCI_VDEVICE(MARVELL, 0x2a30), 3332 PCI_VDEVICE(MARVELL, 0x2a30),
3243 .driver_data = (unsigned long)&di_8687, 3333 .driver_data = (unsigned long)&di_8687,
3244 }, { 3334 }, {
3335 PCI_VDEVICE(MARVELL, 0x2a40),
3336 .driver_data = (unsigned long)&di_8366,
3337 }, {
3245 }, 3338 },
3246}; 3339};
3247MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table); 3340MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table);