Debian Codegraph @

patches/old/zd1211rw_inject.patch

raw
1 --- linux-source-2.6.17-orig/net/ieee80211/ieee80211_tx.c 2006-10-13 14:18:10.000000000 +0200
2 +++ linux/net/ieee80211/ieee80211_tx.c 2007-04-02 23:57:25.000000000 +0200
3 @@ -291,6 +291,23 @@
4 goto success;
5 }
6
7 + if(ieee->iw_mode == IW_MODE_MONITOR)
8 + {
9 + txb = ieee80211_alloc_txb(1, skb->len,
10 + ieee->tx_headroom, GFP_ATOMIC);
11 + if (unlikely(!txb)) {
12 + printk(KERN_WARNING "%s: Could not allocate TXB\n",
13 + ieee->dev->name);
14 + goto failed;
15 + }
16 +
17 + txb->encrypted = 0;
18 + txb->payload_size = skb->len;
19 + memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len);
20 +
21 + goto success;
22 + }
23 +
24 ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto);
25
26 crypt = ieee->crypt[ieee->tx_keyidx];
27 --- linux-source-2.6.17-orig/drivers/net/wireless/zd1211rw/zd_mac.c 2006-10-01 18:42:47.000000000 +0200
28 +++ linux/drivers/net/wireless/zd1211rw/zd_mac.c 2007-04-03 00:01:52.000000000 +0200
29 @@ -180,7 +180,16 @@
30 if (r < 0)
31 goto disable_rx;
32
33 + netif_carrier_on(netdev);
34 +
35 ieee80211softmac_start(netdev);
36 +
37 + if(!netif_queue_stopped(netdev))
38 + netif_start_queue(netdev);
39 + else
40 + netif_wake_queue(netdev);
41 +
42 +
43 return 0;
44 disable_rx:
45 zd_chip_disable_rx(chip);
46 @@ -716,6 +725,8 @@
47 u8 rt_rate;
48 u16 rt_channel;
49 u16 rt_chbitmask;
50 + u8 rt_antsignal;
51 + u8 rt_antnoise;
52 } __attribute__((packed));
53
54 static void fill_rt_header(void *buffer, struct zd_mac *mac,
55 @@ -729,7 +740,9 @@
56 hdr->rt_hdr.it_len = cpu_to_le16(sizeof(struct zd_rt_hdr));
57 hdr->rt_hdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) |
58 (1 << IEEE80211_RADIOTAP_CHANNEL) |
59 - (1 << IEEE80211_RADIOTAP_RATE));
60 + (1 << IEEE80211_RADIOTAP_RATE) |
61 + (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
62 + (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE));
63
64 hdr->rt_flags = 0;
65 if (status->decryption_type & (ZD_RX_WEP64|ZD_RX_WEP128|ZD_RX_WEP256))
66 @@ -743,6 +756,12 @@
67 hdr->rt_chbitmask = cpu_to_le16(IEEE80211_CHAN_2GHZ |
68 ((status->frame_status & ZD_RX_FRAME_MODULATION_MASK) ==
69 ZD_RX_OFDM ? IEEE80211_CHAN_OFDM : IEEE80211_CHAN_CCK));
70 +
71 + hdr->rt_antsignal = status->signal_strength;
72 + if(status->frame_status & ZD_RX_OFDM)
73 + hdr->rt_antnoise = status->signal_strength - status->signal_quality_ofdm;
74 + else
75 + hdr->rt_antnoise = status->signal_strength - status->signal_quality_cck;
76 }
77
78 /* Returns 1 if the data packet is for us and 0 otherwise. */
79 @@ -834,7 +853,8 @@
80 const struct rx_status *status;
81
82 *pstatus = status = zd_tail(buffer, length, sizeof(struct rx_status));
83 - if (status->frame_status & ZD_RX_ERROR) {
84 + if (status->frame_status & ZD_RX_ERROR
85 + || status->frame_status & ~0x21) {
86 /* FIXME: update? */
87 return -EINVAL;
88 }