iw: strip a few more non-essential features from iw-tiny

This commit is contained in:
coolsnowwolf 2018-10-07 21:36:09 +08:00
parent 3207f0d229
commit b05f470d05
2 changed files with 49 additions and 4 deletions

View File

@ -14,13 +14,13 @@ DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \
iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw kmod-macvlan kmod-nft-offload block-mount automount \
iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw kmod-macvlan kmod-nft-offload block-mount \
default-settings luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-ssr-plus luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \
luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol \
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-wrtbwmon
# For nas targets
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm automount autosamba
# For router targets
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall kmod-ipt-offload kmod-tcp-bbr
DEFAULT_PACKAGES.bootloader:=

View File

@ -270,11 +270,11 @@
OBJS += $(OBJS-y) $(OBJS-Y)
+OBJS_FULL = ocb offch cqm wowlan coalesce roc p2p ap
+OBJS_FULL = ocb offch cqm wowlan coalesce roc p2p ap mgmt vendor
+ifdef IW_FULL
+ CFLAGS += -DIW_FULL
+else
+ OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_DISABLED)),$(OBJS))
+ OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_FULL)),$(OBJS))
+endif
ALL = iw
@ -308,3 +308,48 @@
static int handle_station_dump(struct nl80211_state *state,
struct nl_msg *msg,
--- a/interface.c
+++ b/interface.c
@@ -615,9 +615,11 @@ static int handle_interface_wds_peer(str
nla_put_failure:
return -ENOBUFS;
}
+#ifdef IW_FULL
COMMAND(set, peer, "<MAC address>",
NL80211_CMD_SET_WDS_PEER, 0, CIB_NETDEV, handle_interface_wds_peer,
"Set interface WDS peer.");
+#endif
static int set_mcast_rate(struct nl80211_state *state,
struct nl_msg *msg,
@@ -707,6 +709,7 @@ static int handle_chan(struct nl80211_st
return handle_chanfreq(state, msg, true, argc, argv, id);
}
+#ifdef IW_FULL
SECTION(switch);
COMMAND(switch, freq,
"<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]\n"
@@ -715,3 +718,4 @@ COMMAND(switch, freq,
"Switch the operating channel by sending a channel switch announcement (CSA).");
COMMAND(switch, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx]",
NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL);
+#endif
--- a/phy.c
+++ b/phy.c
@@ -359,6 +359,7 @@ static int handle_cac(struct nl80211_sta
return 0;
}
+#ifdef IW_FULL
TOPLEVEL(cac, "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
"freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
"freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
@@ -370,6 +371,7 @@ COMMAND(cac, trigger,
NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger,
"Start or trigger a channel availability check (CAC) looking to look for\n"
"radars on the given channel.");
+#endif
static int handle_fragmentation(struct nl80211_state *state,
struct nl_msg *msg,