From owner-p4-projects@FreeBSD.ORG Sat Jun 7 17:38:13 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6509C106566C; Sat, 7 Jun 2008 17:38:13 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27386106564A for ; Sat, 7 Jun 2008 17:38:13 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE0F8FC0C for ; Sat, 7 Jun 2008 17:38:13 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m57HcCde035469 for ; Sat, 7 Jun 2008 17:38:12 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m57HcCZV035467 for perforce@freebsd.org; Sat, 7 Jun 2008 17:38:12 GMT (envelope-from sam@freebsd.org) Date: Sat, 7 Jun 2008 17:38:12 GMT Message-Id: <200806071738.m57HcCZV035467@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 143083 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2008 17:38:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=143083 Change 143083 by sam@sam_ebb on 2008/06/07 17:37:56 Change the calling convention for ic_node_alloc to deal with multiple longstanding issues: o remove the node table reference, we only have one node table these days and it's likely to move into the com structure so using it to find the com structure will be pointless o pass the vap since it's now the "coin of the realm" and required to do things like set initial tx parameters in private node state for use prior to association o pass the mac address as cards that maintain outboard station tables require this to create an entry (e.g. in ibss mode) Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#84 edit .. //depot/projects/vap/sys/dev/bwi/if_bwi.c#23 edit .. //depot/projects/vap/sys/dev/iwi/if_iwi.c#33 edit .. //depot/projects/vap/sys/dev/iwn/if_iwn.c#22 edit .. //depot/projects/vap/sys/dev/mwl/if_mwl.c#11 edit .. //depot/projects/vap/sys/dev/ral/rt2560.c#39 edit .. //depot/projects/vap/sys/dev/ral/rt2661.c#37 edit .. //depot/projects/vap/sys/dev/usb/if_rum.c#25 edit .. //depot/projects/vap/sys/dev/usb/if_ural.c#23 edit .. //depot/projects/vap/sys/dev/usb/if_zyd.c#24 edit .. //depot/projects/vap/sys/dev/wpi/if_wpi.c#27 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.c#39 edit .. //depot/projects/vap/sys/net80211/ieee80211_var.h#46 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#84 (text+ko) ==== @@ -163,7 +163,8 @@ struct ath_descdma *, ath_bufhead *); static int ath_desc_alloc(struct ath_softc *); static void ath_desc_free(struct ath_softc *); -static struct ieee80211_node *ath_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void ath_node_free(struct ieee80211_node *); static void ath_node_getsignal(const struct ieee80211_node *, int8_t *, int8_t *); @@ -3655,9 +3656,9 @@ } static struct ieee80211_node * -ath_node_alloc(struct ieee80211_node_table *nt) +ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct ieee80211com *ic = nt->nt_ic; + struct ieee80211com *ic = vap->iv_ic; struct ath_softc *sc = ic->ic_ifp->if_softc; const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; struct ath_node *an; ==== //depot/projects/vap/sys/dev/bwi/if_bwi.c#23 (text+ko) ==== @@ -112,7 +112,8 @@ static void bwi_scan_end(struct ieee80211com *); static int bwi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void bwi_updateslot(struct ifnet *); -static struct ieee80211_node *bwi_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *bwi_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void bwi_newassoc(struct ieee80211_node *, int); static int bwi_media_change(struct ifnet *); @@ -1822,7 +1823,7 @@ /* ARGUSED */ static struct ieee80211_node * -bwi_node_alloc(struct ieee80211_node_table *nt __unused) +bwi_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { struct bwi_node *bn; ==== //depot/projects/vap/sys/dev/iwi/if_iwi.c#33 (text+ko) ==== @@ -147,7 +147,8 @@ int); static void iwi_reset_rx_ring(struct iwi_softc *, struct iwi_rx_ring *); static void iwi_free_rx_ring(struct iwi_softc *, struct iwi_rx_ring *); -static struct ieee80211_node *iwi_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *iwi_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void iwi_node_free(struct ieee80211_node *); static void iwi_media_status(struct ifnet *, struct ifmediareq *); static int iwi_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -903,14 +904,14 @@ } static struct ieee80211_node * -iwi_node_alloc(struct ieee80211_node_table *nt) +iwi_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { struct iwi_node *in; in = malloc(sizeof (struct iwi_node), M_80211_NODE, M_NOWAIT | M_ZERO); if (in == NULL) return NULL; - + /* XXX assign sta table entry for adhoc */ in->in_station = -1; return &in->in_node; ==== //depot/projects/vap/sys/dev/iwn/if_iwn.c#22 (text+kox) ==== @@ -105,7 +105,8 @@ int); void iwn_reset_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); void iwn_free_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); -struct ieee80211_node *iwn_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); void iwn_newassoc(struct ieee80211_node *, int); int iwn_media_change(struct ifnet *); int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -943,7 +944,7 @@ } struct ieee80211_node * -iwn_node_alloc(struct ieee80211_node_table *ic) +iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } ==== //depot/projects/vap/sys/dev/mwl/if_mwl.c#11 (text+ko) ==== @@ -135,7 +135,8 @@ #endif static int mwl_dma_setup(struct mwl_softc *); static void mwl_dma_cleanup(struct mwl_softc *); -static struct ieee80211_node *mwl_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *mwl_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void mwl_node_cleanup(struct ieee80211_node *); static void mwl_node_drain(struct ieee80211_node *); static void mwl_node_getsignal(const struct ieee80211_node *, @@ -2650,9 +2651,9 @@ } static struct ieee80211_node * -mwl_node_alloc(struct ieee80211_node_table *nt) +mwl_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct ieee80211com *ic = nt->nt_ic; + struct ieee80211com *ic = vap->iv_ic; struct mwl_softc *sc = ic->ic_ifp->if_softc; const size_t space = sizeof(struct mwl_node); struct mwl_node *mn; @@ -2662,6 +2663,7 @@ /* XXX stat+msg */ return NULL; } + /* XXX setup initial mn_tp */ DPRINTF(sc, MWL_DEBUG_NODE, "%s: mn %p\n", __func__, mn); return &mn->mn_node; ==== //depot/projects/vap/sys/dev/ral/rt2560.c#39 (text) ==== @@ -104,8 +104,8 @@ struct rt2560_rx_ring *); static void rt2560_free_rx_ring(struct rt2560_softc *, struct rt2560_rx_ring *); -static struct ieee80211_node *rt2560_node_alloc( - struct ieee80211_node_table *); +static struct ieee80211_node *rt2560_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void rt2560_newassoc(struct ieee80211_node *, int); static int rt2560_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -767,7 +767,8 @@ } static struct ieee80211_node * -rt2560_node_alloc(struct ieee80211_node_table *nt) +rt2560_node_alloc(struct ieee80211vap *vap, + const uint8_t mac[IEEE80211_ADDR_LEN]) { struct rt2560_node *rn; ==== //depot/projects/vap/sys/dev/ral/rt2661.c#37 (text) ==== @@ -101,8 +101,8 @@ struct rt2661_rx_ring *); static void rt2661_free_rx_ring(struct rt2661_softc *, struct rt2661_rx_ring *); -static struct ieee80211_node *rt2661_node_alloc( - struct ieee80211_node_table *); +static struct ieee80211_node *rt2661_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void rt2661_newassoc(struct ieee80211_node *, int); static int rt2661_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -776,7 +776,8 @@ } static struct ieee80211_node * -rt2661_node_alloc(struct ieee80211_node_table *nt) +rt2661_node_alloc(struct ieee80211vap *vap, + const uint8_t mac[IEEE80211_ADDR_LEN]) { struct rt2661_node *rn; ==== //depot/projects/vap/sys/dev/usb/if_rum.c#25 (text+ko) ==== @@ -195,7 +195,8 @@ struct ieee80211vap *); static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -static struct ieee80211_node *rum_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *rum_node_alloc(struct ieee80211vap *, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) static void rum_newassoc(struct ieee80211_node *, int); static void rum_scan_start(struct ieee80211com *); static void rum_scan_end(struct ieee80211com *); @@ -2394,7 +2395,8 @@ /* ARGUSED */ static struct ieee80211_node * -rum_node_alloc(struct ieee80211_node_table *nt __unused) +rum_node_alloc(struct ieee80211vap *vap __unused, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) { struct rum_node *rn; ==== //depot/projects/vap/sys/dev/usb/if_ural.c#23 (text+ko) ==== @@ -156,7 +156,8 @@ static void ural_bbp_write(struct ural_softc *, uint8_t, uint8_t); static uint8_t ural_bbp_read(struct ural_softc *, uint8_t); static void ural_rf_write(struct ural_softc *, uint8_t, uint32_t); -static struct ieee80211_node *ural_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *ural_node_alloc(struct ieee80211vap *, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) static void ural_newassoc(struct ieee80211_node *, int); static void ural_scan_start(struct ieee80211com *); static void ural_scan_end(struct ieee80211com *); @@ -1759,7 +1760,8 @@ /* ARGUSED */ static struct ieee80211_node * -ural_node_alloc(struct ieee80211_node_table *nt __unused) +ural_node_alloc(struct ieee80211vap *vap __unused, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) { struct ural_node *un; ==== //depot/projects/vap/sys/dev/usb/if_zyd.c#24 (text+ko) ==== @@ -163,7 +163,8 @@ static void zyd_free_tx_list(struct zyd_softc *); static int zyd_alloc_rx_list(struct zyd_softc *); static void zyd_free_rx_list(struct zyd_softc *); -static struct ieee80211_node *zyd_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *zyd_node_alloc(struct ieee80211vap *, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) static void zyd_task(void *); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int zyd_cmd(struct zyd_softc *, uint16_t, const void *, int, @@ -698,7 +699,8 @@ /* ARGUSED */ static struct ieee80211_node * -zyd_node_alloc(struct ieee80211_node_table *nt __unused) +ural_node_alloc(struct ieee80211vap *vap __unused, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) { struct zyd_node *zn; ==== //depot/projects/vap/sys/dev/wpi/if_wpi.c#27 (text+ko) ==== @@ -170,7 +170,8 @@ int, int); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); -static struct ieee80211_node *wpi_node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *wpi_node_alloc(struct ieee80211vap *, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_mem_lock(struct wpi_softc *); static void wpi_mem_unlock(struct wpi_softc *); @@ -1246,7 +1247,8 @@ /* ARGSUSED */ static struct ieee80211_node * -wpi_node_alloc(struct ieee80211_node_table *ic) +wpi_node_alloc(struct ieee80211vap *vap __unused, + const uint8_t mac[IEEE80211_ADDR_LEN] __unused) { struct wpi_node *wn; ==== //depot/projects/vap/sys/net80211/ieee80211_node.c#39 (text+ko) ==== @@ -67,7 +67,8 @@ static int ieee80211_sta_join1(struct ieee80211_node *); -static struct ieee80211_node *node_alloc(struct ieee80211_node_table *); +static struct ieee80211_node *node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); static void node_cleanup(struct ieee80211_node *); static void node_free(struct ieee80211_node *); static void node_age(struct ieee80211_node *); @@ -723,7 +724,7 @@ } static struct ieee80211_node * -node_alloc(struct ieee80211_node_table *nt) +node_alloc(struct ieee80211vap *vap, const uint8_t macaddr[IEEE80211_ADDR_LEN]) { struct ieee80211_node *ni; @@ -948,7 +949,7 @@ struct ieee80211_node *ni; int hash; - ni = ic->ic_node_alloc(nt); + ni = ic->ic_node_alloc(vap, macaddr); if (ni == NULL) { vap->iv_stats.is_rx_nodealloc++; return NULL; @@ -996,7 +997,7 @@ struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; - ni = ic->ic_node_alloc(&ic->ic_sta); + ni = ic->ic_node_alloc(vap, macaddr); if (ni != NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, "%s %p<%s>\n", __func__, ni, ether_sprintf(macaddr)); ==== //depot/projects/vap/sys/net80211/ieee80211_var.h#46 (text+ko) ==== @@ -227,7 +227,8 @@ /* new station association callback/notification */ void (*ic_newassoc)(struct ieee80211_node *, int); /* node state management */ - struct ieee80211_node* (*ic_node_alloc)(struct ieee80211_node_table *); + struct ieee80211_node* (*ic_node_alloc)(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); void (*ic_node_free)(struct ieee80211_node *); void (*ic_node_cleanup)(struct ieee80211_node *); void (*ic_node_age)(struct ieee80211_node *);