PERFORCE change 76716 for review

Sam Leffler sam at FreeBSD.org
Sun May 8 16:12:14 PDT 2005


http://perforce.freebsd.org/chv.cgi?CH=76716

Change 76716 by sam at sam_ebb on 2005/05/08 23:11:36

	o assume 802.11 layer sets priority for outbound frames
	o count packets on base device (not quite right, we only
	  count data frames on recv to avoid counting beacons while
	  xmit stats include mgmt+ctl frames that come from above)

Affected files ...

.. //depot/projects/vap/sys/dev/ath/if_ath.c#8 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/if_ath.c#8 (text+ko) ====

@@ -1375,12 +1375,8 @@
 			goto bad;
 		}
 		pktlen = bf->bf_m->m_pkthdr.len; /* NB: don't reference below */
-		if (ath_tx_start(sc, ni, bf, bf->bf_m) == 0) {
-#if 0 /*XXX*/
-			ifp->if_opackets++;
-#endif
+		if (ath_tx_start(sc, ni, bf, bf->bf_m) == 0)
 			continue;
-		}
 	bad:
 		if (ni != NULL)
 			ieee80211_free_node(ni);
@@ -1601,10 +1597,6 @@
 					bfstaged, bf_list);
 				ATH_TXBUF_UNLOCK(sc);
 			}
-		} else {
-#if 0
-			ifp->if_opackets++;
-#endif
 		}
 	} else {
 		if (an->an_ff_buf[pri] != NULL) {
@@ -1691,7 +1683,6 @@
 					continue;
 				}
 			}
-			ifp->if_opackets++;
 			/*
 			 * Encapsulate the packet in prep for transmission.
 			 */
@@ -3680,6 +3671,10 @@
 					ds->ds_rxstat.rs_rssi,
 					ds->ds_rxstat.rs_tstamp);
 		}
+		if (type == IEEE80211_FC0_TYPE_DATA) {
+			ifp->if_ipackets++;
+			ifp->if_ibytes += len;
+		}
 
 		if (sc->sc_diversity) {
 			/*
@@ -4124,6 +4119,7 @@
 
 	an = ATH_NODE(ni);
 	flags = HAL_TXDESC_CLRDMASK;		/* XXX needed for crypto errs */
+	pri = M_WME_GETAC(m0);			/* set by the 802.11 layer */
 	/*
 	 * Calculate Atheros packet type from IEEE80211 packet header,
 	 * setup for rate calculations, and select h/w transmit queue.
@@ -4144,12 +4140,6 @@
 		if (shortPreamble)
 			txrate |= rt->info[rix].shortPreamble;
 		try0 = ATH_TXMAXTRY;
-		/* NB: force all management frames to highest queue */
-		if (ni->ni_flags & IEEE80211_NODE_QOS) {
-			/* NB: force all management frames to highest queue */
-			pri = WME_AC_VO;
-		} else
-			pri = WME_AC_BE;
 		flags |= HAL_TXDESC_INTREQ;	/* force interrupt */
 		break;
 	case IEEE80211_FC0_TYPE_CTL:
@@ -4158,12 +4148,6 @@
 		txrate = rt->info[rix].rateCode;
 		if (shortPreamble)
 			txrate |= rt->info[rix].shortPreamble;
-		/* NB: force all ctl frames to highest queue */
-		if (ni->ni_flags & IEEE80211_NODE_QOS) {
-			/* NB: force all ctl frames to highest queue */
-			pri = WME_AC_VO;
-		} else
-			pri = WME_AC_BE;
 		flags |= HAL_TXDESC_INTREQ;	/* force interrupt */
 		break;
 	case IEEE80211_FC0_TYPE_DATA:
@@ -4175,17 +4159,12 @@
 			&rix, &try0, &txrate);
 		sc->sc_txrate = txrate;			/* for LED blinking */
 		sc->sc_lastdatarix = rix;		/* for fast frames */
-		/*
-		 * Default all non-QoS traffic to the best-effort queue.
-		 */
 		if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) {
-			pri = M_WME_GETAC(m0);
 			if (cap->cap_wmeParams[pri].wmep_noackPolicy) {
 				flags |= HAL_TXDESC_NOACK;
 				sc->sc_stats.ast_tx_noack++;
 			}
-		} else
-			pri = WME_AC_BE;
+		}
 		break;
 	default:
 		if_printf(ifp, "bogus frame type 0x%x (%s)\n",
@@ -4447,6 +4426,8 @@
 		ath_hal_txstart(ah, txq->axq_qnum);
 	ATH_TXQ_UNLOCK(txq);
 
+	ifp->if_opackets++;
+
 	return 0;
 #undef updateCTSForBursting
 #undef CTS_DURATION


More information about the p4-projects mailing list