linux下支持ap模式的网卡,修复 Linux RTLWifi 驱动的 AP 模式支持

From 59fb30735cbe7eb4f69b13a056947efcc4bfeab0 Mon Sep 17 00:00:00 2001

From: Heiher

Date: Tue, 19 Feb 2013 22:51:22 +0800

Subject: [PATCH] rtlwifi: Fix AP mode.

---

Makefile | 25 ++++++++++++++-----------

core.c | 26 ++++++++++++++++++++++++++

2 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile

index 97935c5..544d22b 100644

--- a/Makefile

+++ b/Makefile

@@ -1,4 +1,4 @@

-obj-$(CONFIG_RTLWIFI) += rtlwifi.o

+obj-m += rtlwifi.o

rtlwifi-objs:=\

base.o\

cam.o\

@@ -11,18 +11,21 @@ rtlwifi-objs:=\

rtl8192c_common-objs +=\

-ifneq ($(CONFIG_PCI),)

rtlwifi-objs+= pci.o

-endif

-

-ifneq ($(CONFIG_USB),)

rtlwifi-objs+= usb.o

-endif

-obj-$(CONFIG_RTL8192C_COMMON)+= rtl8192c/

-obj-$(CONFIG_RTL8192CE)+= rtl8192ce/

-obj-$(CONFIG_RTL8192CU)+= rtl8192cu/

-obj-$(CONFIG_RTL8192SE)+= rtl8192se/

-obj-$(CONFIG_RTL8192DE)+= rtl8192de/

+#obj-m+= rtl8192c/

+#obj-m+= rtl8192ce/

+#obj-m+= rtl8192cu/

+#obj-m+= rtl8192se/

+#obj-m+= rtl8192de/

ccflags-y += -D__CHECK_ENDIAN__

+

+KVERSION = $(shell uname -r)

+

+all:

+make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules

+clean:

+make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

+

diff --git a/core.c b/core.c

index a7c0e52..6e40070 100644

--- a/core.c

+++ b/core.c

@@ -574,6 +574,27 @@ static int rtl_op_conf_tx(struct ieee80211_hw *hw,

return 0;

}

+static void _rtl_update_beacon(struct ieee80211_hw *hw,

+ struct ieee80211_sta *sta, struct ieee80211_vif *vif)

+{

+ struct sk_buff *skb;

+ struct ieee80211_tx_control control;

+

+ control.sta = sta;

+ skb = ieee80211_beacon_get(hw, vif);

+ rtl_op_tx(hw, &control, skb);

+}

+

+static int rtl_op_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,

+ bool set)

+{

+ struct rtl_priv *rtlpriv = rtl_priv(hw);

+

+ _rtl_update_beacon(hw, sta, rtlpriv->mac80211.vif);

+

+ return 0;

+}

+

static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,

struct ieee80211_vif *vif,

struct ieee80211_bss_conf *bss_conf, u32 changed)

@@ -591,6 +612,10 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,

if ((changed & BSS_CHANGED_BEACON) ||

(changed & BSS_CHANGED_BEACON_ENABLED &&

bss_conf->enable_beacon)) {

+rcu_read_lock();

+sta = get_sta(hw, vif, bss_conf->bssid);

+_rtl_update_beacon(hw, sta, vif);

+rcu_read_unlock();

if (mac->beacon_enabled == 0) {

RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,

"BSS_CHANGED_BEACON_ENABLED\n");

@@ -1183,6 +1208,7 @@ const struct ieee80211_ops rtl_ops = {

.configure_filter = rtl_op_configure_filter,

.sta_add = rtl_op_sta_add,

.sta_remove = rtl_op_sta_remove,

+.set_tim = rtl_op_set_tim,

.set_key = rtl_op_set_key,

.conf_tx = rtl_op_conf_tx,

.bss_info_changed = rtl_op_bss_info_changed,

--

1.8.1.3

From 59fb30735cbe7eb4f69b13a056947efcc4bfeab0 Mon Sep 17 00:00:00 2001

From: Heiher

Date: Tue, 19 Feb 2013 22:51:22 +0800

Subject: [PATCH] rtlwifi: Fix AP mode.

---

Makefile | 25 ++++++++++++++-----------

core.c | 26 ++++++++++++++++++++++++++

2 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile

index 97935c5..544d22b 100644

--- a/Makefile

+++ b/Makefile

@@ -1,4 +1,4 @@

-obj-$(CONFIG_RTLWIFI) += rtlwifi.o

+obj-m += rtlwifi.o

rtlwifi-objs:=\

base.o\

cam.o\

@@ -11,18 +11,21 @@ rtlwifi-objs:=\

rtl8192c_common-objs +=\

-ifneq ($(CONFIG_PCI),)

rtlwifi-objs+= pci.o

-endif

-

-ifneq ($(CONFIG_USB),)

rtlwifi-objs+= usb.o

-endif

-obj-$(CONFIG_RTL8192C_COMMON)+= rtl8192c/

-obj-$(CONFIG_RTL8192CE)+= rtl8192ce/

-obj-$(CONFIG_RTL8192CU)+= rtl8192cu/

-obj-$(CONFIG_RTL8192SE)+= rtl8192se/

-obj-$(CONFIG_RTL8192DE)+= rtl8192de/

+#obj-m+= rtl8192c/

+#obj-m+= rtl8192ce/

+#obj-m+= rtl8192cu/

+#obj-m+= rtl8192se/

+#obj-m+= rtl8192de/

ccflags-y += -D__CHECK_ENDIAN__

+

+KVERSION = $(shell uname -r)

+

+all:

+make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules

+clean:

+make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

+

diff --git a/core.c b/core.c

index a7c0e52..6e40070 100644

--- a/core.c

+++ b/core.c

@@ -574,6 +574,27 @@ static int rtl_op_conf_tx(struct ieee80211_hw *hw,

return 0;

}

+static void _rtl_update_beacon(struct ieee80211_hw *hw,

+ struct ieee80211_sta *sta, struct ieee80211_vif *vif)

+{

+ struct sk_buff *skb;

+ struct ieee80211_tx_control control;

+

+ control.sta = sta;

+ skb = ieee80211_beacon_get(hw, vif);

+ rtl_op_tx(hw, &control, skb);

+}

+

+static int rtl_op_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,

+ bool set)

+{

+ struct rtl_priv *rtlpriv = rtl_priv(hw);

+

+ _rtl_update_beacon(hw, sta, rtlpriv->mac80211.vif);

+

+ return 0;

+}

+

static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,

struct ieee80211_vif *vif,

struct ieee80211_bss_conf *bss_conf, u32 changed)

@@ -591,6 +612,10 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,

if ((changed & BSS_CHANGED_BEACON) ||

(changed & BSS_CHANGED_BEACON_ENABLED &&

bss_conf->enable_beacon)) {

+rcu_read_lock();

+sta = get_sta(hw, vif, bss_conf->bssid);

+_rtl_update_beacon(hw, sta, vif);

+rcu_read_unlock();

if (mac->beacon_enabled == 0) {

RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,

"BSS_CHANGED_BEACON_ENABLED\n");

@@ -1183,6 +1208,7 @@ const struct ieee80211_ops rtl_ops = {

.configure_filter = rtl_op_configure_filter,

.sta_add = rtl_op_sta_add,

.sta_remove = rtl_op_sta_remove,

+.set_tim = rtl_op_set_tim,

.set_key = rtl_op_set_key,

.conf_tx = rtl_op_conf_tx,

.bss_info_changed = rtl_op_bss_info_changed,

--

1.8.1.3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值