mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-10 07:34:40 +01:00
Compare commits
6 commits
cc20942931
...
75915e3580
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75915e3580 | ||
|
|
4e0dfa6e27 | ||
|
|
72f43ac220 | ||
|
|
5ba9354fc5 | ||
|
|
7f05a9af9a | ||
|
|
5d7107ef63 |
7 changed files with 57 additions and 60 deletions
|
|
@ -476,6 +476,7 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
struct blob_attr *msg)
|
||||
{
|
||||
struct blob_attr *tb[__DEL_CLIENT_MAX];
|
||||
const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
|
||||
struct sta_info *sta;
|
||||
bool deauth = false;
|
||||
|
|
@ -496,15 +497,19 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
if (tb[DEL_CLIENT_DEAUTH])
|
||||
deauth = blobmsg_get_bool(tb[DEL_CLIENT_DEAUTH]);
|
||||
|
||||
if (deauth)
|
||||
hostapd_drv_sta_deauth(hapd, addr, reason);
|
||||
else
|
||||
hostapd_drv_sta_disassoc(hapd, addr, reason);
|
||||
|
||||
sta = ap_get_sta(hapd, addr);
|
||||
if (sta) {
|
||||
if (deauth) {
|
||||
hostapd_drv_sta_deauth(hapd, addr, reason);
|
||||
if (deauth)
|
||||
ap_sta_deauthenticate(hapd, sta, reason);
|
||||
} else {
|
||||
hostapd_drv_sta_disassoc(hapd, addr, reason);
|
||||
else
|
||||
ap_sta_disassociate(hapd, sta, reason);
|
||||
}
|
||||
} else if (memcmp(addr, bcast, ETH_ALEN) == 0) {
|
||||
hostapd_free_stas(hapd);
|
||||
}
|
||||
|
||||
if (tb[DEL_CLIENT_BAN_TIME])
|
||||
|
|
@ -1844,6 +1849,7 @@ ubus_event_cb(struct ubus_notify_request *req, int idx, int ret)
|
|||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
|
||||
{
|
||||
struct ubus_banned_client *ban;
|
||||
const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
const char *types[HOSTAPD_UBUS_TYPE_MAX] = {
|
||||
[HOSTAPD_UBUS_PROBE_REQ] = "probe",
|
||||
[HOSTAPD_UBUS_AUTH_REQ] = "auth",
|
||||
|
|
@ -1862,6 +1868,10 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
|
|||
if (ban)
|
||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
||||
|
||||
ban = avl_find_element(&hapd->ubus.banned, bcast, ban, avl);
|
||||
if (ban)
|
||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
||||
|
||||
if (!hapd->ubus.obj.has_subscribers)
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,17 +48,6 @@
|
|||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-8 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&ath9k 8 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
|
|
@ -205,15 +194,16 @@
|
|||
device_type = "pci";
|
||||
ranges;
|
||||
|
||||
ath9k: wifi@0,0 {
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,002e";
|
||||
reg = <0 0 0 0 0>;
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>, <&cal_data_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
led {
|
||||
led-sources = <8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,17 +5,6 @@
|
|||
/ {
|
||||
model = "Huawei EchoLife HG556a (version A)";
|
||||
compatible = "huawei,hg556a-a", "brcm,bcm6358";
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-2 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpio_keys {
|
||||
|
|
@ -58,7 +47,7 @@
|
|||
&pci {
|
||||
status = "okay";
|
||||
|
||||
ath9k: wifi@1,0 {
|
||||
wifi@1,0 {
|
||||
compatible = "pci168c,ff1d";
|
||||
reg = <0x0800 0 0 0 0>;
|
||||
|
||||
|
|
@ -67,7 +56,8 @@
|
|||
nvmem-cells = <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
led {
|
||||
led-sources = <2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,17 +5,6 @@
|
|||
/ {
|
||||
model = "Huawei EchoLife HG556a (version B)";
|
||||
compatible = "huawei,hg556a-b", "brcm,bcm6358";
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-2 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpio_keys {
|
||||
|
|
@ -58,7 +47,7 @@
|
|||
&pci {
|
||||
status = "okay";
|
||||
|
||||
ath9k: wifi@1,0 {
|
||||
wifi@1,0 {
|
||||
compatible = "pci168c,0029";
|
||||
reg = <0x0800 0 0 0 0>;
|
||||
|
||||
|
|
@ -67,7 +56,8 @@
|
|||
nvmem-cells = <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
led {
|
||||
led-sources = <2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -38,16 +38,26 @@
|
|||
};
|
||||
};
|
||||
|
||||
&cal_data {
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_data_1fe00: calibration@1fe00 {
|
||||
reg = <0x1fe00 0x200>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pci {
|
||||
status = "okay";
|
||||
|
||||
wifi@1,0 {
|
||||
compatible = "pci0,0";
|
||||
compatible = "pci1814,3062";
|
||||
reg = <0x0800 0 0 0 0>;
|
||||
|
||||
ralink,mtd-eeprom = <&cal_data 0x1fe00>;
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&cal_data_1fe00>, <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
set -e
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
part=
|
||||
offset_blocks=
|
||||
block_size=
|
||||
|
|
@ -99,8 +101,8 @@ switch() {
|
|||
}
|
||||
|
||||
main() {
|
||||
machine=$(sed -n -e 's/^machine\s\+:\s\+//p' < /proc/cpuinfo)
|
||||
if [ "$machine" = "TP-Link Archer VR1200v (v2)" ]; then
|
||||
case "$(board_name)" in
|
||||
tplink,archer-vr1200v-v2)
|
||||
# 03fe0000
|
||||
part=$(part_named '"reserve"')
|
||||
offset_blocks=0
|
||||
|
|
@ -108,7 +110,8 @@ main() {
|
|||
code_offset=0
|
||||
code_openwrt=0000000101000002
|
||||
code_factory=0000000101010003
|
||||
elif [ "$machine" = "Nokia G-240G-E" ]; then
|
||||
;;
|
||||
nokia,g240g-e)
|
||||
part=$(part_named '"flag"')
|
||||
offset_blocks=0
|
||||
block_size=$((1024 * 128))
|
||||
|
|
@ -116,7 +119,8 @@ main() {
|
|||
code_openwrt=000000000000000000000001000000010000000000000000
|
||||
code_factory=000000000000000100000001000000010000000000000000
|
||||
read_mask=000000000000000X00000000000000000000000000000000
|
||||
elif [ "$machine" = "SmartFiber XP8421-B" ]; then
|
||||
;;
|
||||
smartfiber,xp8421-b)
|
||||
# 0dfc0000
|
||||
part=$(part_named '"reservearea"')
|
||||
offset_blocks=12
|
||||
|
|
@ -124,7 +128,8 @@ main() {
|
|||
code_offset=0
|
||||
code_openwrt=30000000
|
||||
code_factory=31000000
|
||||
elif [ "$machine" = "Zyxel PMG5617GA" ]; then
|
||||
;;
|
||||
zyxel,pmg5617ga)
|
||||
# 00060fff
|
||||
part=$(part_named '"reservearea"')
|
||||
offset_blocks=3
|
||||
|
|
@ -132,10 +137,12 @@ main() {
|
|||
code_offset=4095
|
||||
code_openwrt=30
|
||||
code_factory=31
|
||||
else
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported machine: $machine"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$1" = "factory" ]; then
|
||||
switch factory
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/ {
|
||||
model = "Zyxel PMG5617GA";
|
||||
compatible = "tplink,zyxel-pmg5617ga", "econet,en751221";
|
||||
compatible = "zyxel,pmg5617ga", "econet,en751221";
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue