Ivo van Doorn <[EMAIL PROTECTED]> : > Allocate the ieee80211_hw structure for each device > individually to allow the driver to support multiple devices > at the same time. > > Signed-off-by Ivo van Doorn <[EMAIL PROTECTED]> > > diff -U 3 -H -w -E -d -r -N -- > wireless-2.6/drivers/net/wireless/rt2x00/rt2400pci.c > wireless-2.6-rt2x00/drivers/net/wireless/rt2x00/rt2400pci.c > --- wireless-2.6/drivers/net/wireless/rt2x00/rt2400pci.c 2006-02-09 > 20:35:21.000000000 +0100 [...] > @@ -1958,24 +1973,48 @@ > static int > rt2400pci_init_hw(struct rt2x00_pci *rt2x00pci) > { > - ieee80211_hw.host_gen_beacon = 1; > - ieee80211_hw.device_hides_wep = 0; > - ieee80211_hw.rx_includes_fcs = 0; > - ieee80211_hw.host_broadcast_ps_buffering = 1; > - ieee80211_hw.wep_include_iv = 1; > - ieee80211_hw.data_nullfunc_ack = 1; > - ieee80211_hw.no_tkip_wmm_hwaccel = 1; > - ieee80211_hw.extra_hdr_room = 0; > - ieee80211_hw.device_strips_mic = 0; > - ieee80211_hw.fraglist = 0; > + /* > + * IEEE80211 Function callbacks. > + */ > + rt2x00pci->hw.tx = rt2400pci_tx; > + rt2x00pci->hw.reset = rt2400pci_reset; > + rt2x00pci->hw.open = rt2400pci_open; > + rt2x00pci->hw.stop = rt2400pci_stop; > + rt2x00pci->hw.config = rt2400pci_config; > + rt2x00pci->hw.passive_scan = rt2400pci_passive_scan; > + rt2x00pci->hw.get_stats = rt2400pci_get_stats; > + rt2x00pci->hw.set_mac_address = rt2400pci_set_mac_address; > + rt2x00pci->hw.set_retry_limit = rt2400pci_set_retry_limit; > + rt2x00pci->hw.conf_tx = rt2400pci_conf_tx; > + rt2x00pci->hw.get_tx_stats = rt2400pci_get_tx_stats; > + rt2x00pci->hw.get_tsf = rt2400pci_get_tsf; > + rt2x00pci->hw.reset_tsf = rt2400pci_reset_tsf; > + rt2x00pci->hw.beacon_update = rt2400pci_beacon_update; > + rt2x00pci->hw.tx_last_beacon = rt2400pci_tx_last_beacon;
The layout of the configuration block looked fine to me: struct ieee80211_hw *hw = &rt2x00pci->hw; hw->tx = rt2400pci_tx; hw->reset = rt2400pci_reset; hw->open = rt2400pci_open; hw->stop = rt2400pci_stop; hw->config = rt2400pci_config; hw->passive_scan = rt2400pci_passive_scan; hw->get_stats = rt2400pci_get_stats; hw->set_mac_address = rt2400pci_set_mac_address; hw->set_retry_limit = rt2400pci_set_retry_limit; hw->conf_tx = rt2400pci_conf_tx; hw->get_tx_stats = rt2400pci_get_tx_stats; hw->get_tsf = rt2400pci_get_tsf; hw->reset_tsf = rt2400pci_reset_tsf; hw->beacon_update = rt2400pci_beacon_update; hw->tx_last_beacon = rt2400pci_tx_last_beacon; [...] > @@ -1984,52 +2023,52 @@ > * we can increase performance since we > * will have support for high priority TX frames. > */ > - ieee80211_hw.queues = 2; > + rt2x00pci->hw.queues = 2; > > /* > * RT2400 only supports 802.11b. > * Allocate memory for 14 OFDM channels and 4 CCK rates. > */ > - ieee80211_hw.num_modes = 1; > - ieee80211_hw.modes = > + rt2x00pci->hw.num_modes = 1; > + rt2x00pci->hw.modes = > kzalloc(sizeof(struct ieee80211_hw_modes), GFP_KERNEL); > - if(!ieee80211_hw.modes) > + if(!rt2x00pci->hw.modes) Any chance you could be convinced to insert a space after the "if" if asked in a polite manner ? [...] > @@ -2131,13 +2170,13 @@ > rt2x00pci->workqueue = NULL; > } > > - if(likely(ieee80211_hw.modes)){ > - if(likely(ieee80211_hw.modes->channels)) > - kfree(ieee80211_hw.modes->channels); > - if(likely(ieee80211_hw.modes->rates)) > - kfree(ieee80211_hw.modes->rates); > - kfree(ieee80211_hw.modes); > - ieee80211_hw.modes = NULL; > + if(likely(rt2x00pci->hw.modes)){ > + if(likely(rt2x00pci->hw.modes->channels)) > + kfree(rt2x00pci->hw.modes->channels); No need to test: kfree(NULL) is fine. [...] > @@ -2148,6 +2187,7 @@ > rt2400pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) > { > struct net_device *net_dev = NULL; > + struct rt2x00_pci *rt2x00pci = NULL; None of the NULL initializers is needed. -- Ueimor - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html