Ticket #907: madwifi-parent.6.diff
| File madwifi-parent.6.diff, 5.5 kB (added by mentor, 5 years ago) |
|---|
-
net80211/ieee80211_input.c
old new 53 53 #include "if_athproto.h" 54 54 55 55 #include <net80211/ieee80211_var.h> 56 #include <net80211/ieee80211_proto.h> 56 57 57 58 #ifdef IEEE80211_DEBUG 58 59 /* … … 3316 3317 if (vap->iv_set_tim != NULL) 3317 3318 vap->iv_set_tim(ni, 0); 3318 3319 } 3319 M_PWR_SAV_SET(skb); /* bypass PS handling*/3320 skb->dev = vap->iv_dev; /* XXX needed? */ 3321 (void) dev_queue_xmit(skb); /* resubmit*/3320 M_PWR_SAV_SET(skb); /* ensure MORE_DATA bit is set correctly */ 3321 3322 ieee80211_parent_queue_xmit(skb); /* Submit to parent device, including updating stats */ 3322 3323 } 3323 3324 3324 3325 #ifdef ATH_SUPERG_FF -
net80211/ieee80211_output.c
old new 226 226 227 227 if (vap->iv_opmode == IEEE80211_M_MONITOR) { 228 228 ieee80211_monitor_encap(vap, skb); 229 skb->dev = parent; 230 (void) dev_queue_xmit(skb); 229 ieee80211_parent_queue_xmit(skb); 231 230 return 0; 232 231 } 233 232 if (ic->ic_flags & IEEE80211_F_SCAN) /* cancel bg scan */ … … 252 251 "%s: discard, classification failure", __func__); 253 252 goto bad; 254 253 } 254 255 cb->ni = ni; 256 255 257 /* power-save checks */ 256 258 if (WME_UAPSD_AC_CAN_TRIGGER(skb->priority, ni)) { 257 259 /* U-APSD power save queue */ 258 260 /* XXXAPSD: assuming triggerable means deliverable */ 259 261 M_FLAG_SET(skb, M_UAPSD); 260 } else if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && !M_PWR_SAV_GET(skb)) {262 } else if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT)) { 261 263 /* 262 264 * Station in power save mode; stick the frame 263 265 * on the sta's power save queue and continue. 264 266 * We'll get the frame back when the time is right. 265 267 */ 266 268 ieee80211_pwrsave(ni, skb); 267 goto reclaim;269 return 0; 268 270 } 269 M_FLAG_KEEP_ONLY(skb, M_UAPSD | M_PWR_SAV);270 cb->ni = ni;271 271 272 vap->iv_devstats.tx_packets++;273 vap->iv_devstats.tx_bytes += skb->len;274 ic->ic_lastdata = jiffies;275 276 skb->dev = parent;277 272 #ifdef ATH_SUPERG_XR 278 273 /* 279 274 * broadcast/multicast packets need to be sent on XR vap in addition to 280 275 * normal vap. 281 276 */ 277 278 /* FIXME: ieee80211_parent_queue_xmit */ 282 279 if (vap->iv_xrvap && ni == vap->iv_bss && 283 280 vap->iv_xrvap->iv_sta_assoc) { 284 281 struct sk_buff *skb1; … … 293 290 } 294 291 } 295 292 #endif 296 (void) dev_queue_xmit(skb);293 ieee80211_parent_queue_xmit(skb); 297 294 return 0; 295 298 296 bad: 299 297 if (skb != NULL) 300 298 dev_kfree_skb(skb); 301 reclaim:302 299 if (ni != NULL) 303 300 ieee80211_free_node(ni); 304 301 return 0; 305 302 } 306 303 304 void ieee80211_parent_queue_xmit(struct sk_buff *skb) { 305 struct ieee80211vap *vap = skb->dev->priv; 306 307 vap->iv_devstats.tx_packets++; 308 vap->iv_devstats.tx_bytes += skb->len; 309 vap->iv_ic->ic_lastdata = jiffies; 310 311 // Dispatch the packet to the parent device 312 skb->dev = vap->iv_ic->ic_dev; 313 (void) dev_queue_xmit(skb); 314 } 315 307 316 /* 308 317 * Set the direction field and address fields of an outgoing 309 318 * non-QoS frame. Note this should be called early on in -
net80211/ieee80211_power.c
old new 48 48 #include "if_media.h" 49 49 50 50 #include <net80211/ieee80211_var.h> 51 #include <net80211/ieee80211_proto.h> 51 52 52 53 static void ieee80211_set_tim(struct ieee80211_node *ni, int set); 53 54 … … 111 112 112 113 IEEE80211_NODE_SAVEQ_LOCK(ni); 113 114 qlen = skb_queue_len(&ni->ni_savedq); 114 while ((skb = __skb_dequeue(&ni->ni_savedq)) != NULL) 115 while ((skb = __skb_dequeue(&ni->ni_savedq)) != NULL) { 116 ieee80211_free_node(ni); 115 117 dev_kfree_skb_any(skb); 118 } 116 119 IEEE80211_NODE_SAVEQ_UNLOCK(ni); 117 120 118 121 return qlen; … … 208 211 209 212 spin_lock_irqsave(&ni->ni_savedq.lock, flags); 210 213 if (skb_queue_len(&ni->ni_savedq) >= IEEE80211_PS_MAX_QUEUE) { 211 IEEE80211_NODE_STAT(ni, psq_drops);214 IEEE80211_NODE_STAT(ni, psq_drops); 212 215 spin_unlock_irqrestore(&ni->ni_savedq.lock, flags); 213 216 IEEE80211_NOTE(vap, IEEE80211_MSG_ANY, ni, 214 217 "pwr save q overflow, drops %d (size %d)", … … 300 303 * 301 304 * Set the M_PWR_SAV bit on skb to allow encap to test for 302 305 * adding MORE_DATA bit to wh. 306 * 307 * The 802.11 MAC Spec says we should only set MORE_DATA for 308 * unicast packets when the STA is in PS mode (7.1.3.1.8); 309 * which it isn't. 303 310 */ 304 M_PWR_SAV_SET(skb);311 // M_PWR_SAV_SET(skb); 305 312 306 313 #ifdef ATH_SUPERG_XR 307 314 /* … … 313 320 skb->dev = vap->iv_xrvap->iv_dev; 314 321 else 315 322 skb->dev = vap->iv_dev; /* XXX? unnecessary */ 316 #else317 skb->dev = vap->iv_dev; /* XXX? unnecessary */318 323 #endif 319 dev_queue_xmit(skb); 324 325 ieee80211_parent_queue_xmit(skb); 320 326 } 321 327 vap->iv_set_tim(ni, 0); 322 328 } … … 356 362 IEEE80211_NODE_SAVEQ_UNLOCK(ni); 357 363 if (skb == NULL) 358 364 break; 359 dev_queue_xmit(skb);365 ieee80211_parent_queue_xmit(skb); 360 366 } 361 367 } 362 368 } else { -
net80211/ieee80211_proto.h
old new 72 72 int, int, u_int32_t); 73 73 void ieee80211_sta_pwrsave(struct ieee80211vap *, int); 74 74 int ieee80211_hardstart(struct sk_buff *, struct net_device *); 75 void ieee80211_parent_queue_xmit(struct sk_buff *); 75 76 int ieee80211_send_nulldata(struct ieee80211_node *); 76 77 int ieee80211_send_qosnulldata(struct ieee80211_node *, int); 77 78 int ieee80211_send_mgmt(struct ieee80211_node *, int, int);
