From: ashwin c. <ash...@gm...> - 2006-10-25 16:14:40
|
The generic ieee80211 network stack in 2.6.18 (vanilla) has a call to ieee80211_classify(skb) in its xmit routine. If I understand this right, then this routine maps the ToS field to 802.1Dprio. (?) and then sets the header's qos_ctl accordingly to signify QoS data or QoS NULL. But, the xmit routine also accepts a prio parameter which is passed on, as is, to the low level device drivers hard_xmit. Looking at my ipw2200 driver, I find that this prio value is used to map to the appropriate h/w queues, with the assumption that its value is already a 802.1D prio. So my suggestion is that we need not do the classification (ieee80211_classify) in the stack, at least at the point where it is right now. As long as the priority value that comes in the xmit function of the stack is non-zero, header->qos_ctl != NULL. In any case for apps that mangle the ToS field for their QoS requirements, the mapping from ToS to 1D prio can be done elsewhere ( pardon the uncertainty here, I'm quite the novice). :) Cheers, Ashwin Signed-off-by: Ashwin Chaugule <ash...@gm...> -- --- ieee80211_tx.c-orig 2006-10-25 20:24:09.000000000 +0530 +++ ieee80211_tx.c 2006-10-25 20:27:02.000000000 +0530 @@ -219,35 +219,6 @@ return txb; } -static int ieee80211_classify(struct sk_buff *skb) -{ - struct ethhdr *eth; - struct iphdr *ip; - - eth = (struct ethhdr *)skb->data; - if (eth->h_proto != __constant_htons(ETH_P_IP)) - return 0; - - ip = skb->nh.iph; - switch (ip->tos & 0xfc) { - case 0x20: - return 2; - case 0x40: - return 1; - case 0x60: - return 3; - case 0x80: - return 4; - case 0xa0: - return 5; - case 0xc0: - return 6; - case 0xe0: - return 7; - default: - return 0; - } -} /* Incoming skb is converted to a txb which consists of * a block of 802.11 fragment packets (stored as skbs) */ @@ -335,9 +306,8 @@ if (ieee->is_qos_active && ieee->is_qos_active(dev, skb)) { fc |= IEEE80211_STYPE_QOS_DATA; hdr_len += 2; - - skb->priority = ieee80211_classify(skb); - header.qos_ctl |= cpu_to_le16(skb->priority & IEEE80211_QCTL_TID); + if (priority <= 7) + header.qos_ctl |= cpu_to_le16(skb->priority & IEEE80211_QCTL_TID); } header.frame_ctl = cpu_to_le16(fc); -- |