Skip to content

Commit

Permalink
rtlwifi: finishing touches
Browse files Browse the repository at this point in the history
 - put debugfs into ieee80211/phyX

 - usb transmit has to bypass IS_USB_STOP
   for firmware download

 - move DESC_PACKET definitions to wifi

 - introduce rtl_mac80211_init

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
  • Loading branch information
chunkeey committed May 26, 2014
1 parent db9eb44 commit ac5e40d
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 61 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -6,17 +6,17 @@ KMOD_SRC ?= $(CURDIR)/rtlwifi
KMOD_OPTIONS = CONFIG_RTL_CARDS=y
KMOD_OPTIONS += CONFIG_RTLWIFI=m
KMOD_OPTIONS += CONFIG_RTLWIFI_DEBUG=y
KMOD_OPTIONS += CONFIG_RTLWIFI_DEBUGFS=y
KMOD_OPTIONS += CONFIG_RTLWIFI_USB=m
KMOD_OPTIONS += CONFIG_RTLWIFI_PCI=m
KMOD_OPTIONS += CONFIG_RTL8192SU=m
KMOD_OPTIONS += CONFIG_RTL8192SU_DEBUGFS=m
KMOD_OPTIONS += CONFIG_RTL8192SE=m
KMOD_OPTIONS += CONFIG_RTL8192S_COMMON=m

# Don't build any of the other drivers
KMOD_OPTIONS += CONFIG_RTL8192CU=n CONFIG_RTL8192DE=n CONFIG_RTL8192CE=n CONFIG_RTL8192C_COMMON=n CONFIG_RTL8723AE=n CONFIG_RTL8188EE=n

EXTRA_CFLAGS += -DDEBUG
EXTRA_CFLAGS += -DDEBUG -DCONFIG_RTLWIFI_DEBUGFS=m

all:
$(MAKE) -C $(KSRC) M=$(KMOD_SRC) $(KMOD_OPTIONS) $(MAKECMDGOALS) EXTRA_CFLAGS="$(EXTRA_CFLAGS)"
Expand Down
11 changes: 9 additions & 2 deletions rtlwifi/core.c
Expand Up @@ -96,6 +96,14 @@ void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
}
EXPORT_SYMBOL(rtl_bb_delay);

void rtl_mac80211_init(struct ieee80211_hw *hw)
{
/*init rfkill */
rtl_init_rfkill(hw);
rtl_register_debugfs(hw);
}
EXPORT_SYMBOL(rtl_mac80211_init);

void rtl_fw_cb(const struct firmware *firmware, void *context)
{
struct ieee80211_hw *hw = context;
Expand Down Expand Up @@ -140,8 +148,7 @@ void rtl_fw_cb(const struct firmware *firmware, void *context)
}
set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);

/*init rfkill */
rtl_init_rfkill(hw);
rtl_mac80211_init(hw);
}
EXPORT_SYMBOL(rtl_fw_cb);

Expand Down
2 changes: 1 addition & 1 deletion rtlwifi/core.h
Expand Up @@ -45,5 +45,5 @@ void rtl_addr_delay(u32 addr);
void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
u32 mask, u32 data);
void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data);

void rtl_mac80211_init(struct ieee80211_hw *hw);
#endif
1 change: 1 addition & 0 deletions rtlwifi/debug.c
Expand Up @@ -365,6 +365,7 @@ DEBUGFS_DECLARE_WO_FILE(hw_iowrite);
int rtl_register_debugfs(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);

rtlpriv->dbg.dfs = debugfs_create_dir(KBUILD_MODNAME,
hw->wiphy->debugfsdir);

Expand Down
7 changes: 0 additions & 7 deletions rtlwifi/pci.c
Expand Up @@ -2045,13 +2045,6 @@ int rtl_pci_probe(struct pci_dev *pdev,
goto fail3;
}

err = rtl_register_debugfs(hw);
if (err) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
"Can't initialize debugfs\n");
err = -ENODEV;
goto fail3;
}
rtlpriv->cfg->ops->init_sw_leds(hw);

err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
Expand Down
5 changes: 0 additions & 5 deletions rtlwifi/rtl8192s/fw_common.h
Expand Up @@ -82,11 +82,6 @@ enum rtl8192s_hci_type {
#define FW_PWR_TRK_PARAM_CLR 0x0000ffff
#define FW_RA_PARAM_CLR 0xffff0000

enum desc_packet_type {
DESC_PACKET_TYPE_INIT = 0,
DESC_PACKET_TYPE_NORMAL = 1,
};

/* 8-bytes alignment required */
struct fw_priv {
/* --- long word 0 ---- */
Expand Down
20 changes: 0 additions & 20 deletions rtlwifi/rtl8192se/hw.c
Expand Up @@ -1007,23 +1007,3 @@ void rtl92se_resume(struct ieee80211_hw *hw)
pci_write_config_dword(rtlpci->pdev, 0x40,
val & 0xffff00ff);
}

/* Turn on AAP (RCR:bit 0) for promicuous mode. */
void rtl92se_allow_all_destaddr(struct ieee80211_hw *hw,
bool allow_all_da, bool write_into_reg)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));

if (allow_all_da) /* Set BIT0 */
rtlpci->receive_config |= RCR_AAP;
else /* Clear BIT0 */
rtlpci->receive_config &= ~RCR_AAP;

if (write_into_reg)
rtl_write_dword(rtlpriv, RCR, rtlpci->receive_config);

RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD,
"receive_config=0x%08X, write_into_reg=%d\n",
rtlpci->receive_config, write_into_reg);
}
1 change: 1 addition & 0 deletions rtlwifi/rtl8192se/sw.c
Expand Up @@ -121,6 +121,7 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
return;
} else {
rtlpriv->mac80211.mac80211_registered = 1;
rtl_mac80211_init(hw);
}
rtlpci->irq_alloc = 1;
set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
Expand Down
5 changes: 0 additions & 5 deletions rtlwifi/rtl8192su/hw.c
Expand Up @@ -839,11 +839,6 @@ void rtl92su_card_disable(struct ieee80211_hw *hw)
udelay(100);
}

void rtl92su_interrupt_recognized(struct ieee80211_hw *hw, u32 *p_inta,
u32 *p_intb)
{
}

void rtl92su_update_interrupt_mask(struct ieee80211_hw *hw,
u32 add_msr, u32 rm_msr)
{
Expand Down
1 change: 1 addition & 0 deletions rtlwifi/rtl8192su/sw.c
Expand Up @@ -78,6 +78,7 @@ static void rtl92su_fw_cb(const struct firmware *firmware, void *context)
return;
} else {
rtlpriv->mac80211.mac80211_registered = 1;
rtl_mac80211_init(hw);
}
set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
}
Expand Down
7 changes: 0 additions & 7 deletions rtlwifi/rtl8192su/trx.c
Expand Up @@ -706,13 +706,6 @@ void rtl92su_rx_hdl(struct ieee80211_hw *hw, struct sk_buff * skb)
_rtl_rx_process(hw, skb);
}

void rtl92s_rx_segregate_hdl(
struct ieee80211_hw *hw,
struct sk_buff *skb,
struct sk_buff_head *skb_list)
{
}

void rtl92su_tx_cleanup(struct ieee80211_hw *hw, struct sk_buff *skb)
{
}
Expand Down
21 changes: 9 additions & 12 deletions rtlwifi/usb.c
Expand Up @@ -934,10 +934,6 @@ int rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
struct sk_buff *_skb = NULL;

WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl);
if (unlikely(IS_USB_STOP(rtlusb))) {
RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
"USB device is stopping...\n");
}
ep_num = rtlusb->ep_map.ep_mapping[qnum];
_skb = skb;
_urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num, callback);
Expand Down Expand Up @@ -1009,14 +1005,21 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw,
static int rtl_usb_tx(struct ieee80211_hw *hw,
struct ieee80211_sta *sta,
struct sk_buff *skb,
struct rtl_tcb_desc *dummy)
struct rtl_tcb_desc *tcb_desc)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
__le16 fc = hdr->frame_control;
u16 hw_queue;

if (unlikely(IS_USB_STOP(rtlusb)) &&
tcb_desc->cmd_or_init != DESC_PACKET_TYPE_INIT) {
RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
"USB device is stopping...\n");
goto err_free;
}
if (unlikely(is_hal_stop(rtlhal)))
goto err_free;
hw_queue = rtlusb->usb_mq_to_hwq(fc, skb_get_queue_mapping(skb));
Expand Down Expand Up @@ -1118,12 +1121,6 @@ int rtl_usb_probe(struct usb_interface *intf,
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
goto error_out;
}
err = rtl_register_debugfs(hw);
if (err) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
"Can't initialize debugfs\n");
goto error_out;
}
rtlpriv->cfg->ops->init_sw_leds(hw);

return 0;
Expand Down
5 changes: 5 additions & 0 deletions rtlwifi/wifi.h
Expand Up @@ -1844,6 +1844,11 @@ struct rt_link_detect {
bool higher_busytxtraffic[MAX_TID_COUNT];
};

enum desc_packet_type {
DESC_PACKET_TYPE_INIT = 0,
DESC_PACKET_TYPE_NORMAL = 1,
};

struct rtl_tcb_desc {
u8 packet_bw:1;
u8 multicast:1;
Expand Down

0 comments on commit ac5e40d

Please sign in to comment.