rtlwifi: unbreak usb drivers
[openwrt/svn-archive/archive.git] / package / kernel / mac80211 / patches / 345-rtl8192cu-Call-ieee80211_register_hw-from-rtl_usb_pr.patch
1 From: Karsten Wiese <fzuuzf@googlemail.com>
2 Date: Wed, 22 Oct 2014 15:47:33 +0200
3 Subject: [PATCH] rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe
4
5 In a previous patch the call to ieee80211_register_hw was moved from the
6 load firmware callback to the rtl_pci_probe only.
7 rt8192cu also uses this callback. Currently it doesnt create a wlan%d device.
8 Fill in the call to ieee80211_register_hw in rtl_usb_probe.
9
10 Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
11 ---
12
13 --- a/drivers/net/wireless/rtlwifi/usb.c
14 +++ b/drivers/net/wireless/rtlwifi/usb.c
15 @@ -1117,7 +1117,18 @@ int rtl_usb_probe(struct usb_interface *
16 }
17 rtlpriv->cfg->ops->init_sw_leds(hw);
18
19 + err = ieee80211_register_hw(hw);
20 + if (err) {
21 + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
22 + "Can't register mac80211 hw.\n");
23 + err = -ENODEV;
24 + goto error_out;
25 + }
26 + rtlpriv->mac80211.mac80211_registered = 1;
27 +
28 + set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
29 return 0;
30 +
31 error_out:
32 rtl_deinit_core(hw);
33 _rtl_usb_io_handler_release(hw);