Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171463
b: refs/heads/master
c: 6f6d1e9
h: refs/heads/master
i:
  171461: bdcd17b
  171459: 3eeba2e
  171455: 91a3ce8
v: v3
  • Loading branch information
Lennert Buytenhek authored and John W. Linville committed Nov 6, 2009
1 parent d4c36b6 commit 696e77c
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e484c8964f7845d320eb1161c514dbfcafdda78
refs/heads/master: 6f6d1e9a8a7fea5e4400cad64bed717e322208e1
95 changes: 94 additions & 1 deletion trunk/drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,89 @@ static inline void mwl8k_add_dma_header(struct sk_buff *skb)


/*
* Packet reception.
* Packet reception for 88w8366.
*/
struct mwl8k_rxd_8366 {
__le16 pkt_len;
__u8 sq2;
__u8 rate;
__le32 pkt_phys_addr;
__le32 next_rxd_phys_addr;
__le16 qos_control;
__le16 htsig2;
__le32 hw_rssi_info;
__le32 hw_noise_floor_info;
__u8 noise_floor;
__u8 pad0[3];
__u8 rssi;
__u8 rx_status;
__u8 channel;
__u8 rx_ctrl;
} __attribute__((packed));

#define MWL8K_8366_RX_CTRL_OWNED_BY_HOST 0x80

static void mwl8k_rxd_8366_init(void *_rxd, dma_addr_t next_dma_addr)
{
struct mwl8k_rxd_8366 *rxd = _rxd;

rxd->next_rxd_phys_addr = cpu_to_le32(next_dma_addr);
rxd->rx_ctrl = MWL8K_8366_RX_CTRL_OWNED_BY_HOST;
}

static void mwl8k_rxd_8366_refill(void *_rxd, dma_addr_t addr, int len)
{
struct mwl8k_rxd_8366 *rxd = _rxd;

rxd->pkt_len = cpu_to_le16(len);
rxd->pkt_phys_addr = cpu_to_le32(addr);
wmb();
rxd->rx_ctrl = 0;
}

static int
mwl8k_rxd_8366_process(void *_rxd, struct ieee80211_rx_status *status)
{
struct mwl8k_rxd_8366 *rxd = _rxd;

if (!(rxd->rx_ctrl & MWL8K_8366_RX_CTRL_OWNED_BY_HOST))
return -1;
rmb();

memset(status, 0, sizeof(*status));

status->signal = -rxd->rssi;
status->noise = -rxd->noise_floor;

if (rxd->rate & 0x80) {
status->flag |= RX_FLAG_HT;
status->rate_idx = rxd->rate & 0x7f;
} else {
int i;

for (i = 0; i < ARRAY_SIZE(mwl8k_rates); i++) {
if (mwl8k_rates[i].hw_value == rxd->rate) {
status->rate_idx = i;
break;
}
}
}

status->band = IEEE80211_BAND_2GHZ;
status->freq = ieee80211_channel_to_frequency(rxd->channel);

return le16_to_cpu(rxd->pkt_len);
}

static struct rxd_ops rxd_8366_ops = {
.rxd_size = sizeof(struct mwl8k_rxd_8366),
.rxd_init = mwl8k_rxd_8366_init,
.rxd_refill = mwl8k_rxd_8366_refill,
.rxd_process = mwl8k_rxd_8366_process,
};

/*
* Packet reception for 88w8687.
*/
struct mwl8k_rxd_8687 {
__le16 pkt_len;
Expand Down Expand Up @@ -3226,6 +3308,14 @@ static void mwl8k_finalize_join_worker(struct work_struct *work)
priv->beacon_skb = NULL;
}

static struct mwl8k_device_info di_8366 = {
.part_name = "88w8366",
.helper_image = "mwl8k/helper_8366.fw",
.fw_image = "mwl8k/fmimage_8366.fw",
.rxd_ops = &rxd_8366_ops,
.modes = 0,
};

static struct mwl8k_device_info di_8687 = {
.part_name = "88w8687",
.helper_image = "mwl8k/helper_8687.fw",
Expand All @@ -3241,6 +3331,9 @@ static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
}, {
PCI_VDEVICE(MARVELL, 0x2a30),
.driver_data = (unsigned long)&di_8687,
}, {
PCI_VDEVICE(MARVELL, 0x2a40),
.driver_data = (unsigned long)&di_8366,
}, {
},
};
Expand Down

0 comments on commit 696e77c

Please sign in to comment.