o wl3501: keep it simple, support only ARPHRD_ETHER packets

parent 47cd2e39
...@@ -514,7 +514,6 @@ struct wl3501_card { ...@@ -514,7 +514,6 @@ struct wl3501_card {
u16 esbq_confirm; u16 esbq_confirm;
u8 essid[WL3501_ESSID_MAX_LEN]; u8 essid[WL3501_ESSID_MAX_LEN];
unsigned char bssid[ETH_ALEN]; unsigned char bssid[ETH_ALEN];
int ether_type;
int net_type; int net_type;
u8 keep_essid[WL3501_ESSID_MAX_LEN]; u8 keep_essid[WL3501_ESSID_MAX_LEN];
unsigned char nick[32]; unsigned char nick[32];
......
...@@ -642,42 +642,20 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size) ...@@ -642,42 +642,20 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size)
size -= 12; size -= 12;
wl3501_get_from_wla(this, this->start_seg + 2, wl3501_get_from_wla(this, this->start_seg + 2,
&next_addr, sizeof(next_addr)); &next_addr, sizeof(next_addr));
if (this->ether_type == ARPHRD_ETHER) { if (size > WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr)) {
if (size > WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr)) { wl3501_get_from_wla(this,
wl3501_get_from_wla(this, this->start_seg +
this->start_seg + sizeof(struct wl3501_rx_hdr), data,
sizeof(struct wl3501_rx_hdr), WL3501_BLKSZ -
data, sizeof(struct wl3501_rx_hdr));
WL3501_BLKSZ - size -= WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr);
sizeof(struct wl3501_rx_hdr)); data += WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr);
size -= WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr);
data += WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr);
} else {
wl3501_get_from_wla(this,
this->start_seg +
sizeof(struct wl3501_rx_hdr),
data, size);
size = 0;
}
} else { } else {
size -= 2; wl3501_get_from_wla(this,
*data = (size >> 8) & 0xff; this->start_seg +
*(data + 1) = size & 0xff; sizeof(struct wl3501_rx_hdr),
data += 2; data, size);
if (size > WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6) { size = 0;
wl3501_get_from_wla(this,
this->start_seg + offset_addr4,
data,
WL3501_BLKSZ -
sizeof(struct wl3501_rx_hdr) + 6);
size -= WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6;
data += WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6;
} else {
wl3501_get_from_wla(this,
this->start_seg + offset_addr4,
data, size);
size = 0;
}
} }
while (size > 0) { while (size > 0) {
if (size > WL3501_BLKSZ - 5) { if (size > WL3501_BLKSZ - 5) {
...@@ -860,17 +838,12 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, ...@@ -860,17 +838,12 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
sig.data + sig.data +
offsetof(struct wl3501_rx_hdr, addr4), offsetof(struct wl3501_rx_hdr, addr4),
&addr4, sizeof(addr4)); &addr4, sizeof(addr4));
if (addr4[0] == 0xAA && addr4[1] == 0xAA && if (!(addr4[0] == 0xAA && addr4[1] == 0xAA &&
addr4[2] == 0x03 && addr4[4] == 0x00) { addr4[2] == 0x03 && addr4[4] == 0x00)) {
pkt_len = sig.size + 12 - 24 - 4 - 6; printk(KERN_INFO "Insupported packet type!\n");
this->ether_type = ARPHRD_ETHER; return;
} else if (addr4[0] == 0xE0 && addr4[1] == 0xE0) {
pkt_len = sig.size + 12 - 24 - 4 + 2;
this->ether_type = ARPHRD_IEEE80211; /* FIXME */
} else {
pkt_len = sig.size + 12 - 24 - 4 + 2;
this->ether_type = ARPHRD_IEEE80211; /* FIXME */
} }
pkt_len = sig.size + 12 - 24 - 4 - 6;
skb = dev_alloc_skb(pkt_len + 5); skb = dev_alloc_skb(pkt_len + 5);
...@@ -1578,7 +1551,7 @@ static int wl3501_get_wap(struct net_device *dev, struct iw_request_info *info, ...@@ -1578,7 +1551,7 @@ static int wl3501_get_wap(struct net_device *dev, struct iw_request_info *info,
{ {
struct wl3501_card *this = (struct wl3501_card *)dev->priv; struct wl3501_card *this = (struct wl3501_card *)dev->priv;
wrqu->ap_addr.sa_family = this->ether_type; wrqu->ap_addr.sa_family = ARPHRD_ETHER;
memcpy(wrqu->ap_addr.sa_data, this->bssid, ETH_ALEN); memcpy(wrqu->ap_addr.sa_data, this->bssid, ETH_ALEN);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment