mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 02:17:58 +00:00 
			
		
		
		
	Compare commits
	
		
			33 Commits
		
	
	
		
			v2.7.1-rc1
			...
			v2.7.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | b6776698b6 | ||
|   | 8233c10569 | ||
|   | 6ce868a890 | ||
|   | fb73d889ed | ||
|   | 05e2b6319e | ||
|   | 80bfb8671d | ||
|   | 521df1a142 | ||
|   | 72a75b72ac | ||
|   | c22dce10d3 | ||
|   | 8eb801a0cc | ||
|   | 25d7b9d62d | ||
|   | 6eaef7adad | ||
|   | 0272d4bcad | ||
|   | 41c64e9978 | ||
|   | 9c2f0a098d | ||
|   | 0bb8d0dcc0 | ||
|   | a542660072 | ||
|   | 8ee15d0053 | ||
|   | 311515867c | ||
|   | 16bbcddd40 | ||
|   | ca26d347eb | ||
|   | 9eeefa2fbf | ||
|   | c33705ca60 | ||
|   | ba41e6773b | ||
|   | 8ebf884436 | ||
|   | 7d4353caf0 | ||
|   | fa6220a615 | ||
|   | 26517bb6ae | ||
|   | ea4c4b3fe5 | ||
|   | 00f273000e | ||
|   | 6014d3a04d | ||
|   | 08f082acfe | ||
|   | 12e5efcda4 | 
							
								
								
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							| @@ -21,7 +21,7 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         target: ['actiontec_web7200', 'cig_wf188n', 'cig_wf196', 'cig_wf610d', 'cig_wf808', 'cybertan_eww622-a1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'liteon_wpx8324', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'edgecore_spw2ac1200-lan-poe', 'hfcl_ion4', 'hfcl_ion4xe', 'hfcl_ion4xi', 'indio_um-305ac', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'linksys_ea6350-v4', 'linksys_e8450-ubi', 'linksys_ea8300', 'meshpp_s618_cp03', 'meshpp_s618_cp01', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'x64_vm' ] | ||||
|         target: ['actiontec_web7200', 'cig_wf188n', 'cig_wf196', 'cig_wf610d', 'cig_wf808', 'cybertan_eww622-a1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'liteon_wpx8324', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'edgecore_spw2ac1200-lan-poe', 'hfcl_ion4', 'hfcl_ion4xe', 'hfcl_ion4xi', 'indio_um-305ac', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'linksys_ea6350-v4', 'linksys_e8450-ubi', 'linksys_ea8300', 'meshpp_s618_cp03', 'meshpp_s618_cp01', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018_v4', 'x64_vm' ] | ||||
|  | ||||
|     steps: | ||||
|     - uses: actions/checkout@v2 | ||||
|   | ||||
							
								
								
									
										83
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										83
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,20 +1,83 @@ | ||||
| # Setting up your build machine | ||||
| # OpenWiFi AP NOS | ||||
|  | ||||
| Requires a recent linux installation. Older systems without python 3.7 will have trouble.  See this link for details: https://openwrt.org/docs/guide-developer/quickstart-build-images | ||||
| OpenWrt-based access point network operating system (AP NOS) for TIP OpenWiFi. | ||||
| Read more at [openwifi.tip.build](https://openwifi.tip.build/). | ||||
|  | ||||
| Install build packages:  sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml. | ||||
| ## Building | ||||
|  | ||||
| # Doing a native build on Linux | ||||
| First we need to clone and setup our tree. This will result in an openwrt/. | ||||
| ### Setting up your build machine | ||||
|  | ||||
| Building requires a recent Linux installation. Older systems without Python 3.7 | ||||
| will have trouble. See this guide for details: | ||||
| https://openwrt.org/docs/guide-developer/toolchain/beginners-build-guide | ||||
|  | ||||
| Install build packages on Debian/Ubuntu (or see above guide for other systems): | ||||
| ``` | ||||
| ./setup.py --setup | ||||
| sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml | ||||
| ``` | ||||
| Next we need to select the profile and base package selection. This setup will install the feeds, packages and generate the .config file. | ||||
|  | ||||
| ### Doing a native build on Linux | ||||
|  | ||||
| Use `./build.sh <target>`, or follow the manual steps below: | ||||
|  | ||||
| 1. Clone and set up the tree. This will create an `openwrt/` directory. | ||||
| ```shell | ||||
| ./setup.py --setup    # for subsequent builds, use --rebase instead | ||||
| ``` | ||||
|  | ||||
| 2. Select the profile and base package selection. This setup will install the | ||||
|    feeds and packages and generate the `.config` file. | ||||
| ```shell | ||||
| cd openwrt | ||||
| ./scripts/gen_config.py linksys_ea8300 | ||||
| ``` | ||||
| Finally we can build the tree. | ||||
| ``` | ||||
| make -j X V=s | ||||
|  | ||||
| 3. Build the tree (replace `-j 8` with the number of cores to use). | ||||
| ```shell | ||||
| make -j 8 V=s | ||||
| ``` | ||||
|  | ||||
| ### Build output | ||||
|  | ||||
| The build results are located in the `openwrt/bin/` directory: | ||||
|  | ||||
| | Type             | Path                                                 | | ||||
| | ---------------- | ---------------------------------------------------- | | ||||
| | Firmware images  | `openwrt/bin/targets/<target>/<subtarget>/`          | | ||||
| | Kernel modules   | `openwrt/bin/targets/<target>/<subtarget>/packages/` | | ||||
| | Package binaries | `openwrt/bin/packages/<platform>/<feed>/`            | | ||||
|  | ||||
| ## Developer Notes | ||||
|  | ||||
| ### Branching model | ||||
|  | ||||
| - `main` - Stable dev branch | ||||
| - `next` - Integration branch | ||||
| - `staging-*` - Feature/bug branches | ||||
| - `release/v#.#.#` - Release branches (*major.minor.patch*) | ||||
|  | ||||
| ### Repository structure | ||||
|  | ||||
| Build files: | ||||
| - `Makefile` - Calls Docker environment per target | ||||
| - `dock-run.sh` - Dockerized build environment | ||||
| - `docker/Dockerfile` - Dockerfile for build image | ||||
| - `build.sh` - Build script | ||||
| - `setup.py` - Clone and set up the tree | ||||
| - `config.yml` - Specifies OpenWrt version and patches to apply | ||||
|  | ||||
| Directories: | ||||
| - `feeds/` - OpenWiFi feeds | ||||
| - `patches/` - OpenWiFi patches applied during builds | ||||
| - `profiles/` - Per-target kernel configs, packages, and feeds | ||||
|     - [wifi-ax](profiles/wifi-ax.yml): Wi-Fi AX packages | ||||
|     - [ucentral-ap](profiles/ucentral-ap.yml): uCentral packages | ||||
|     - [x64_vm](profiles/x64_vm.yml): x86-64 VM image | ||||
|  | ||||
| ### uCentral packages | ||||
|  | ||||
| AP-NOS packages implementing the uCentral protocol include the following | ||||
| repositories (refer to the [ucentral](feeds/ucentral/) feed for a full list): | ||||
| - ucentral-client: https://github.com/Telecominfraproject/wlan-ucentral-client | ||||
| - ucentral-schema: https://github.com/Telecominfraproject/wlan-ucentral-schema | ||||
| - ucentral-wifi: https://github.com/blogic/ucentral-wifi | ||||
|   | ||||
| @@ -85,13 +85,24 @@ qcom_setup_macs() | ||||
|  | ||||
| 	case $board in | ||||
| 	cig,wf194c|\ | ||||
| 	cig,wf194c4|\ | ||||
| 	cig,wf196) | ||||
| 	cig,wf194c4) | ||||
| 		mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2) | ||||
| 		wan_mac=$(macaddr_canonicalize $mac) | ||||
| 		lan_mac=$(macaddr_add "$wan_mac" 1) | ||||
| 		ucidef_set_network_device_mac eth0 $lan_mac | ||||
| 		ucidef_set_network_device_mac eth1 $wan_mac | ||||
| 		ip link set eth0 address $lan_mac | ||||
| 		ip link set eth1 address $wan_mac | ||||
| 		ucidef_set_label_macaddr $wan_mac | ||||
| 		;; | ||||
| 	cig,wf196) | ||||
| 		mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2) | ||||
| 		wan_mac=$(macaddr_canonicalize $mac) | ||||
| 		lan_mac=$(macaddr_add "$wan_mac" 1) | ||||
| 		ucidef_set_network_device_mac eth1 $lan_mac | ||||
| 		ucidef_set_network_device_mac eth0 $wan_mac | ||||
| 		ip link set eth0 address $wan_mac | ||||
| 		ip link set eth1 address $lan_mac | ||||
| 		ucidef_set_label_macaddr $wan_mac | ||||
| 		;; | ||||
| 	cybertan,eww622-a1) | ||||
|   | ||||
| @@ -65,6 +65,7 @@ static void __client_free(struct interface *iface, struct client *cl) | ||||
| 		avl_delete(&iface->client_ids, &cl->id_node); | ||||
| 	avl_delete(&iface->clients, &cl->node); | ||||
| 	kvlist_free(&cl->kvdata); | ||||
| 	free(cl->device); | ||||
| 	spotfilter_bpf_set_client(iface, &cl->key, NULL); | ||||
| 	free(cl); | ||||
| } | ||||
| @@ -143,8 +144,10 @@ int client_set(struct interface *iface, const void *addr, const char *id, | ||||
|  | ||||
| 		kvlist_set(&cl->kvdata, blobmsg_name(cur), cur); | ||||
| 	} | ||||
| 	if (device) | ||||
| 		cl->device = device; | ||||
| 	if (device) { | ||||
| 		free(cl->device); | ||||
| 		cl->device = strdup(device); | ||||
| 	} | ||||
| 	if (state >= 0) | ||||
| 		cl->data.cur_class = state; | ||||
| 	if (dns_state >= 0) | ||||
|   | ||||
| @@ -17,7 +17,7 @@ struct client { | ||||
|  | ||||
| 	struct spotfilter_client_key key; | ||||
| 	struct spotfilter_client_data data; | ||||
| 	const char *device; | ||||
| 	char *device; | ||||
| }; | ||||
|  | ||||
| int client_set(struct interface *iface, const void *addr, const char *id, | ||||
|   | ||||
| @@ -147,6 +147,7 @@ nl80211_device_update(struct interface *iface, struct device *dev) | ||||
|  | ||||
| 	nl_send_auto_complete(genl, msg); | ||||
| 	nlmsg_free(msg); | ||||
| 	nl_wait_for_ack(genl); | ||||
| } | ||||
|  | ||||
| static void | ||||
|   | ||||
| @@ -5,9 +5,9 @@ PKG_RELEASE:=1 | ||||
|  | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_URL=https://github.com/blogic/udevmand.git | ||||
| PKG_MIRROR_HASH:=25e47c7f3d454cc5eba4e9c19fc9da8431e3c2b1b97b8f0f49798f51c2722df7 | ||||
| PKG_MIRROR_HASH:=51bcf59754ef87913c40f2f1c708c8d2d2eb0ad5fc128a5c891e54ea4b3b035e | ||||
| PKG_SOURCE_DATE:=20220112 | ||||
| PKG_SOURCE_VERSION:=065f75cb88aa317441adffeddc8d5302cfaafc8a | ||||
| PKG_SOURCE_VERSION:=3d2b67b180679a6f5687e8d318a66a7cbad3fa7b | ||||
| CMAKE_INSTALL:=1 | ||||
|  | ||||
| PKG_LICENSE:=LGPL-2.1 | ||||
|   | ||||
| @@ -32,11 +32,15 @@ function get_idle_timeout(mac) { | ||||
| } | ||||
|  | ||||
| function get_session_timeout(mac) { | ||||
| 	if (clients[mac]?.session_timeout) | ||||
| 		return clients[mac].session_timeout; | ||||
| 	if (clients[mac]?.session) | ||||
| 		return clients[mac].session; | ||||
| 	return session_timeout; | ||||
| } | ||||
|  | ||||
| function radius_available(mac) { | ||||
| 	return !!clients[mac]?.radius; | ||||
| } | ||||
|  | ||||
| function radius_init(mac, payload) { | ||||
| 	for (let key in [ 'server', 'acct_server', 'acct_session', 'client_ip', 'called_station', 'calling_station', 'nas_ip', 'nas_id', 'username' ]) | ||||
| 		if (clients[mac].radius[key]) | ||||
| @@ -53,6 +57,8 @@ function radius_call(mac, payload) { | ||||
| } | ||||
|  | ||||
| function radius_stop(mac) { | ||||
| 	if (!radius_available(mac)) | ||||
| 		return; | ||||
| 	debug(mac, 'stopping accounting'); | ||||
|  | ||||
| 	let payload = { | ||||
| @@ -88,6 +94,8 @@ function radius_acct(mac, payload) { | ||||
| } | ||||
|  | ||||
| function radius_idle_time(mac) { | ||||
| 	if (!radius_available(mac)) | ||||
| 		return; | ||||
| 	let payload = { | ||||
| 		acct_type: 2, | ||||
| 		terminate_cause: 4, | ||||
| @@ -96,6 +104,8 @@ function radius_idle_time(mac) { | ||||
| } | ||||
|  | ||||
| function radius_session_time(mac) { | ||||
| 	if (!radius_available(mac)) | ||||
| 		return; | ||||
| 	let payload = { | ||||
| 		acct_type: 2, | ||||
| 		terminate_cause: 5, | ||||
| @@ -104,6 +114,8 @@ function radius_session_time(mac) { | ||||
| } | ||||
|  | ||||
| function radius_disconnect(mac) { | ||||
| 	if (!radius_available(mac)) | ||||
| 		return; | ||||
| 	let payload = { | ||||
| 		acct_type: 2, | ||||
| 		terminate_cause: 1, | ||||
| @@ -112,6 +124,8 @@ function radius_disconnect(mac) { | ||||
| } | ||||
|  | ||||
| function radius_interim(mac) { | ||||
| 	if (!radius_available(mac)) | ||||
| 		return; | ||||
| 	let payload = { | ||||
| 		acct_type: 3, | ||||
| 	}; | ||||
| @@ -126,17 +140,25 @@ function client_add(mac, state) { | ||||
| 	if (state.state != 1) | ||||
| 		return; | ||||
|  | ||||
| 	let interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || acct_interval) * 1000; | ||||
| 	let idle = (state.data?.radius?.reply['Idle-Timeout'] || idle_timeout); | ||||
| 	let session = (state.data?.radius?.reply['Session-Timeout'] || session_timeout); | ||||
| 	let interval = acct_interval * 1000; | ||||
| 	let idle = idle_timeout; | ||||
| 	let session = session_timeout; | ||||
| 	let accounting = (config.radius?.acct_server && config.radius?.acct_secret); | ||||
|  | ||||
| 	if (state.data?.radius?.reply) { | ||||
| 		interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || acct_interval) * 1000; | ||||
| 		idle = (state.data?.radius?.reply['Idle-Timeout'] || idle_timeout); | ||||
| 		session = (state.data?.radius?.reply['Session-Timeout'] || session_timeout); | ||||
| 	} | ||||
|  | ||||
| 	clients[mac] = { | ||||
| 		accounting, | ||||
| 		radius: state.data.radius.request, | ||||
| 		interval, | ||||
| 		session, | ||||
| 		idle, | ||||
| 	}; | ||||
| 	if (state.data?.radius?.request) | ||||
| 		clients[mac].radius= state.data.radius.request; | ||||
| 	syslog(mac, 'adding client'); | ||||
| 	if (accounting) | ||||
| 		clients[mac].timeout = uloop.timer(interval, () => radius_interim(mac)); | ||||
| @@ -167,6 +189,7 @@ function client_timeout(mac) { | ||||
| 	ubus.call('spotfilter', 'client_set', { | ||||
| 			interface: "hotspot", | ||||
| 			state: 0, | ||||
| 			dns_state: 1, | ||||
| 			address: mac, | ||||
| 			accounting: [], | ||||
| 			flush: true, | ||||
|   | ||||
| @@ -46,7 +46,6 @@ return { | ||||
| 		case 'aa-bb-cc-dd-ee-ff': | ||||
| 		case 'AA-BB-CC-DD-EE-FF': | ||||
| 			mac = replace(mac, ':', '-'); | ||||
| 			warn('uspot: ' + ctx.env.REMOTE_ADDR + ' - ' + msg + '\n'); | ||||
| 			break; | ||||
| 		} | ||||
|  | ||||
| @@ -140,7 +139,7 @@ return { | ||||
| 			acct_server: sprintf('%s:%s:%s', this.config.radius.acct_server, this.config.radius.acct_port, this.config.radius.acct_secret), | ||||
| 			acct_session, | ||||
| 			client_ip: ctx.env.REMOTE_ADDR, | ||||
| 			called_station: this.config.uam.nasmac, | ||||
| 			called_station: this.config.uam.nasmac + ':' + ctx.ssid, | ||||
| 			calling_station: this.format_mac(ctx.mac), | ||||
| 			nas_ip: ctx.env.SERVER_ADDR, | ||||
| 			nas_id: this.config.uam.nasid | ||||
|   | ||||
| @@ -120,7 +120,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
|  	else | ||||
|  #endif /* CONFIG_P2P */ | ||||
| -		os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr)); | ||||
| +		os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000, sta->bandwidth[1] / 1000); | ||||
| +		os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000000, sta->bandwidth[1] / 1000000); | ||||
|   | ||||
|  	if (hapd->sta_authorized_cb) | ||||
|  		hapd->sta_authorized_cb(hapd->sta_authorized_cb_ctx, | ||||
|   | ||||
| @@ -0,0 +1,12 @@ | ||||
| Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c | ||||
| =================================================================== | ||||
| --- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/mac.c | ||||
| +++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/mac.c | ||||
| @@ -9356,6 +9356,7 @@ static int __ath11k_mac_register(struct | ||||
|  	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); | ||||
|  	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_STA_TX_PWR); | ||||
|  	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_BSS_COLOR); | ||||
| +	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0); | ||||
|   | ||||
|  	if (test_bit(WMI_TLV_SERVICE_SCAN_PHYMODE_SUPPORT, | ||||
|  		     ar->ab->wmi_ab.svc_map)) | ||||
| @@ -137,7 +137,7 @@ index 0000000000..f2f4a933d7 | ||||
| + 	else | ||||
| + #endif /* CONFIG_P2P */ | ||||
| +-		os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr)); | ||||
| ++		os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000, sta->bandwidth[1] / 1000); | ||||
| ++		os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000000, sta->bandwidth[1] / 1000000); | ||||
| +  | ||||
| + 	if (hapd->sta_authorized_cb) | ||||
| + 		hapd->sta_authorized_cb(hapd->sta_authorized_cb_ctx, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user