Ticket #1397: tsf-per-packet.diff
| File tsf-per-packet.diff, 13.3 kB (added by mentor, 5 years ago) |
|---|
-
net80211/ieee80211_scan.c
old new 831 831 ieee80211_add_scan(struct ieee80211vap *vap, 832 832 const struct ieee80211_scanparams *sp, 833 833 const struct ieee80211_frame *wh, 834 int subtype, int rssi, int rstamp)834 int subtype, int rssi, u_int64_t rstamp) 835 835 { 836 836 struct ieee80211com *ic = vap->iv_ic; 837 837 struct ieee80211_scan_state *ss = ic->ic_scan; -
net80211/ieee80211_node.c
old new 1601 1601 ni->ni_rxseqs[i] >> IEEE80211_SEQ_SEQ_SHIFT, 1602 1602 ni->ni_rxseqs[i] & IEEE80211_SEQ_FRAG_MASK); 1603 1603 } 1604 printf("\trstamp % u rssi %u intval %u capinfo 0x%x\n",1604 printf("\trstamp %10llu rssi %u intval %u capinfo 0x%x\n", 1605 1605 ni->ni_rstamp, ni->ni_rssi, ni->ni_intval, ni->ni_capinfo); 1606 1606 printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n", 1607 1607 ether_sprintf(ni->ni_bssid), -
net80211/ieee80211_scan.h
old new 100 100 101 101 struct ieee80211_scanparams; 102 102 void ieee80211_add_scan(struct ieee80211vap *, const struct ieee80211_scanparams *, 103 const struct ieee80211_frame *, int, int, int);103 const struct ieee80211_frame *, int, int, u_int64_t); 104 104 void ieee80211_scan_timeout(struct ieee80211com *); 105 105 106 106 void ieee80211_scan_assoc_success(struct ieee80211com *, … … 156 156 u_int8_t se_ssid[2 + IEEE80211_NWID_LEN]; 157 157 u_int8_t se_rates[2 + IEEE80211_RATE_MAXSIZE]; 158 158 u_int8_t se_xrates[2 + IEEE80211_RATE_MAXSIZE]; 159 u_int 32_t se_rstamp; /* recv timestamp */159 u_int64_t se_rstamp; /* recv timestamp */ 160 160 union { 161 161 u_int8_t data[8]; 162 162 __le64 tsf; … … 196 196 /* add an entry to the cache */ 197 197 int (*scan_add)(struct ieee80211_scan_state *, 198 198 const struct ieee80211_scanparams *, 199 const struct ieee80211_frame *, int, int, int);199 const struct ieee80211_frame *, int, int, u_int64_t); 200 200 /* age and/or purge entries in the cache */ 201 201 void (*scan_age)(struct ieee80211_scan_state *); 202 202 /* note that association failed for an entry */ -
net80211/ieee80211_node.h
old new 136 136 int ni_rxkeyoff; /* Receive key offset */ 137 137 138 138 /* hardware */ 139 u_int 32_t ni_rstamp; /* recv timestamp */139 u_int64_t ni_rstamp; /* recv timestamp */ 140 140 u_int32_t ni_last_rx; /* recv jiffies */ 141 141 u_int8_t ni_rssi; /* recv ssi */ 142 142 -
net80211/ieee80211_scan_sta.c
old new 215 215 */ 216 216 static int 217 217 sta_add(struct ieee80211_scan_state *ss, const struct ieee80211_scanparams *sp, 218 const struct ieee80211_frame *wh, int subtype, int rssi, int rstamp)218 const struct ieee80211_frame *wh, int subtype, int rssi, u_int64_t rstamp) 219 219 { 220 220 #define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) 221 221 #define PICK1ST(_ss) \ -
net80211/ieee80211_wireless.c
old new 1064 1064 for (i = 0; i < number; i++) 1065 1065 memcpy(&vap->iv_spy.mac[i * IEEE80211_ADDR_LEN], 1066 1066 address[i].sa_data, IEEE80211_ADDR_LEN); 1067 /* init rssi timestamps */1068 memset(vap->iv_spy.ts_rssi, 0, IW_MAX_SPY * sizeof(u_int32_t));1067 /* init rssi timestamps to 0 */ 1068 memset(vap->iv_spy.ts_rssi, 0, sizeof(vap->iv_spy.ts_rssi)); 1069 1069 } 1070 1070 vap->iv_spy.num = number; 1071 1071 -
net80211/ieee80211_input.c
old new 193 193 */ 194 194 int 195 195 ieee80211_input(struct ieee80211_node *ni, 196 struct sk_buff *skb, int rssi, u_int 32_t rstamp)196 struct sk_buff *skb, int rssi, u_int64_t rstamp) 197 197 { 198 198 #define HAS_SEQ(type) ((type & 0x4) == 0) 199 199 struct ieee80211vap *vap = ni->ni_vap; … … 894 894 */ 895 895 int 896 896 ieee80211_input_all(struct ieee80211com *ic, 897 struct sk_buff *skb, int rssi, u_int 32_t rstamp)897 struct sk_buff *skb, int rssi, u_int64_t rstamp) 898 898 { 899 899 struct ieee80211vap *vap; 900 900 int type = -1; … … 1229 1229 1230 1230 static void 1231 1231 ieee80211_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh, 1232 int rssi, u_int 32_t rstamp, u_int16_t seq, u_int16_t status)1232 int rssi, u_int64_t rstamp, u_int16_t seq, u_int16_t status) 1233 1233 { 1234 1234 struct ieee80211vap *vap = ni->ni_vap; 1235 1235 unsigned int tmpnode = 0; … … 1372 1372 /* XXX TODO: add statistics */ 1373 1373 static void 1374 1374 ieee80211_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, 1375 u_int8_t *frm, u_int8_t *efrm, int rssi, u_int 32_t rstamp,1375 u_int8_t *frm, u_int8_t *efrm, int rssi, u_int64_t rstamp, 1376 1376 u_int16_t seq, u_int16_t status) 1377 1377 { 1378 1378 struct ieee80211vap *vap = ni->ni_vap; … … 2530 2530 */ 2531 2531 void 2532 2532 ieee80211_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb, 2533 int subtype, int rssi, u_int 32_t rstamp)2533 int subtype, int rssi, u_int64_t rstamp) 2534 2534 { 2535 2535 #define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) 2536 2536 #define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP) -
net80211/ieee80211_scan_ap.c
old new 250 250 */ 251 251 static int 252 252 ap_add(struct ieee80211_scan_state *ss, const struct ieee80211_scanparams *sp, 253 const struct ieee80211_frame *wh, int subtype, int rssi, int rstamp)253 const struct ieee80211_frame *wh, int subtype, int rssi, u_int64_t rstamp) 254 254 { 255 255 struct ap_state *as = ss->ss_priv; 256 256 struct ieee80211vap *vap = ss->ss_vap; -
net80211/ieee80211_var.h
old new 131 131 #define IW_MAX_SPY 8 132 132 struct ieee80211_spy { 133 133 u_int8_t mac[IW_MAX_SPY * IEEE80211_ADDR_LEN]; 134 u_int 32_t ts_rssi[IW_MAX_SPY]; /* ts of rssi value from last read */134 u_int64_t ts_rssi[IW_MAX_SPY]; /* ts of rssi value from last read */ 135 135 u_int8_t thr_low; /* 1 byte rssi value, 0 = threshold is off */ 136 136 u_int8_t thr_high; /* 1 byte rssi value */ 137 137 u_int8_t num; … … 361 361 /* Send/recv 802.11 management frame */ 362 362 int (*ic_send_mgmt)(struct ieee80211_node *, int, int); 363 363 void (*ic_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, 364 int, u_int 32_t);364 int, u_int64_t); 365 365 366 366 /* Send management frame to driver (like hardstart) */ 367 367 int (*ic_mgtstart)(struct ieee80211com *, struct sk_buff *); -
net80211/ieee80211_proto.h
old new 63 63 64 64 struct ieee80211_node; 65 65 struct ieee80211_channel *ieee80211_doth_findchan(struct ieee80211vap *, u_int8_t); 66 int ieee80211_input(struct ieee80211_node *, struct sk_buff *, int, u_int 32_t);67 int ieee80211_input_all(struct ieee80211com *, struct sk_buff *, int, u_int 32_t);66 int ieee80211_input(struct ieee80211_node *, struct sk_buff *, int, u_int64_t); 67 int ieee80211_input_all(struct ieee80211com *, struct sk_buff *, int, u_int64_t); 68 68 int ieee80211_setup_rates(struct ieee80211_node *, const u_int8_t *, 69 69 const u_int8_t *, int); 70 70 void ieee80211_saveie(u_int8_t **, const u_int8_t *); 71 71 void ieee80211_saveath(struct ieee80211_node *, u_int8_t *); 72 72 void ieee80211_recv_mgmt(struct ieee80211_node *, struct sk_buff *, 73 int, int, u_int 32_t);73 int, int, u_int64_t); 74 74 void ieee80211_sta_pwrsave(struct ieee80211vap *, int); 75 75 int ieee80211_hardstart(struct sk_buff *, struct net_device *); 76 76 void ieee80211_parent_queue_xmit(struct sk_buff *); -
ath/if_athvar.h
old new 392 392 struct ieee80211_node *bf_node; /* pointer to the node */ 393 393 u_int32_t bf_status; /* status flags */ 394 394 u_int16_t bf_flags; /* tx descriptor flags */ 395 u_int64_t bf_tsf; 395 396 #ifdef ATH_SUPERG_FF 396 397 /* XXX: combine this with bf_skbaddr if it ever changes to accommodate 397 398 * multiple segments. … … 531 532 struct ath_stats sc_stats; /* private statistics */ 532 533 int devid; 533 534 int sc_debug; 534 void (*sc_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, int, u_int 32_t);535 void (*sc_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, int, u_int64_t); 535 536 void (*sc_node_cleanup)(struct ieee80211_node *); 536 537 void (*sc_node_free)(struct ieee80211_node *); 537 538 void *sc_bdev; /* associated bus device */ -
ath/if_ath.c
old new 167 167 static u_int8_t ath_node_getrssi(const struct ieee80211_node *); 168 168 static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); 169 169 static void ath_recv_mgmt(struct ieee80211_node *, struct sk_buff *, int, 170 int, u_int 32_t);170 int, u_int64_t); 171 171 static void ath_setdefantenna(struct ath_softc *, u_int); 172 172 static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int); 173 173 static void ath_rx_tasklet(TQUEUE_ARG); … … 1433 1433 if (HAL_EINPROGRESS == retval) 1434 1434 break; 1435 1435 1436 /* update the per packet TSF with sc_tsf, sc_tsf is updated on 1437 each RX interrupt. */ 1438 bf->bf_tsf = sc->sc_tsf; 1439 1436 1440 /* XXX: We do not support frames spanning multiple descriptors */ 1437 1441 bf->bf_status |= ATH_BUFSTATUS_DONE; 1438 1442 … … 5331 5335 * tsf to extend this to 64 bits. 5332 5336 */ 5333 5337 /* NB: Not all chipsets return the same precision rstamp */ 5334 u_int64_t tsf = ath_extend_tsf( sc->sc_tsf, rs->rs_tstamp);5338 u_int64_t tsf = ath_extend_tsf(bf->bf_tsf, rs->rs_tstamp); 5335 5339 5336 5340 KASSERT(ic->ic_flags & IEEE80211_F_DATAPAD, 5337 5341 ("data padding not enabled?")); … … 5422 5426 */ 5423 5427 static void 5424 5428 ath_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb, 5425 int subtype, int rssi, u_int 32_t rstamp)5429 int subtype, int rssi, u_int64_t rstamp) 5426 5430 { 5427 5431 struct ath_softc *sc = ni->ni_ic->ic_dev->priv; 5428 5432 struct ieee80211vap *vap = ni->ni_vap; … … 5449 5453 case IEEE80211_FC0_SUBTYPE_PROBE_RESP: 5450 5454 if (vap->iv_opmode == IEEE80211_M_IBSS && 5451 5455 vap->iv_state == IEEE80211_S_RUN) { 5452 u_int64_t tsf = ath_extend_tsf(sc->sc_tsf, rstamp);5453 5456 /* 5454 5457 * Handle ibss merge as needed; check the tsf on the 5455 5458 * frame before attempting the merge. The 802.11 spec … … 5463 5466 /* jal: added: don't merge if we have a desired 5464 5467 BSSID */ 5465 5468 if (!(vap->iv_flags & IEEE80211_F_DESBSSID) && 5466 le64_to_cpu(ni->ni_tstamp.tsf) >= tsf) {5469 le64_to_cpu(ni->ni_tstamp.tsf) >= rstamp) { 5467 5470 DPRINTF(sc, ATH_DEBUG_STATE, 5468 "ibss merge, rstamp %u tsf %llu "5469 "tstamp %llu\n", rstamp, (unsigned long long) tsf,5471 "ibss merge, tsf %10llu tstamp %10llu\n", 5472 rstamp, 5470 5473 (unsigned long long) le64_to_cpu(ni->ni_tstamp.tsf)); 5471 5474 (void) ieee80211_ibss_merge(ni); 5472 5475 } … … 5506 5509 unsigned int len; 5507 5510 int type; 5508 5511 u_int phyerr; 5512 u_int64_t rs_tsf; 5509 5513 5510 5514 /* Let the 802.11 layer know about the new noise floor */ 5511 5515 sc->sc_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan)); … … 5699 5703 sc->sc_hwmap[rs->rs_rate].ieeerate, 5700 5704 rs->rs_rssi); 5701 5705 5706 rs_tsf = ath_extend_tsf(bf->bf_tsf, rs->rs_tstamp); 5707 5702 5708 /* 5703 5709 * Locate the node for sender, track state, and then 5704 5710 * pass the (referenced) node up to the 802.11 layer … … 5714 5720 */ 5715 5721 an = ATH_NODE(ieee80211_ref_node(ni)); 5716 5722 ATH_RSSI_LPF(an->an_avgrssi, rs->rs_rssi); 5717 type = ieee80211_input(ni, skb, rs->rs_rssi, rs ->rs_tstamp);5723 type = ieee80211_input(ni, skb, rs->rs_rssi, rs_tsf); 5718 5724 ieee80211_unref_node(&ni); 5719 5725 } else { 5720 5726 /* … … 5728 5734 ieee80211_keyix_t keyix; 5729 5735 5730 5736 ATH_RSSI_LPF(an->an_avgrssi, rs->rs_rssi); 5731 type = ieee80211_input(ni, skb, rs->rs_rssi,rs ->rs_tstamp);5737 type = ieee80211_input(ni, skb, rs->rs_rssi,rs_tsf); 5732 5738 /* 5733 5739 * If the station has a key cache slot assigned 5734 5740 * update the key->node mapping table. … … 5739 5745 sc->sc_keyixmap[keyix] = ieee80211_ref_node(ni); 5740 5746 ieee80211_unref_node(&ni); 5741 5747 } else 5742 type = ieee80211_input_all(ic, skb, 5743 rs->rs_rssi, rs->rs_tstamp); 5748 type = ieee80211_input_all(ic, skb, rs->rs_rssi, rs_tsf); 5744 5749 } 5745 5750 5746 5751 if (sc->sc_diversity) {
