summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Yeryomin <roman@advem.lv>2014-03-12 01:00:34 +0200
committerRoman Yeryomin <roman@advem.lv>2014-03-12 01:00:34 +0200
commit1af8a0acb0f703c79ad1da0490a35405c5a08ed4 (patch)
treed328d9aa60ee7554d156c4114a5add0572b145f1
parentc98eff7a7e5f1bbb3250d745f128fde6b6dda38a (diff)
Fix calibration data parsing for hostapd realtek driver.
Signed-off-by: Roman Yeryomin <roman@advem.lv>
-rw-r--r--package/hostapd-rtk/patches/009-hostapd-from-3.2.4.patch220
-rw-r--r--package/hostapd-rtk/patches/010-driver_realtek-fix-parse_pwrlevel.patch59
2 files changed, 59 insertions, 220 deletions
diff --git a/package/hostapd-rtk/patches/009-hostapd-from-3.2.4.patch b/package/hostapd-rtk/patches/009-hostapd-from-3.2.4.patch
index 080646c35..64ea8cc4e 100644
--- a/package/hostapd-rtk/patches/009-hostapd-from-3.2.4.patch
+++ b/package/hostapd-rtk/patches/009-hostapd-from-3.2.4.patch
@@ -1,136 +1,3 @@
-diff -purbB --unidirectional-new-file -x '.*' -x '*.o' hostapd-rtk-0.6.10/hostapd/hostapd.wpa_psk_conf hostapd-0.6.10/hostapd/hostapd.wpa_psk_conf
---- hostapd-rtk-0.6.10/hostapd/hostapd.wpa_psk_conf 1970-01-01 03:00:00.000000000 +0300
-+++ hostapd-0.6.10/hostapd/hostapd.wpa_psk_conf 2013-05-02 01:48:29.316224177 +0300
-@@ -0,0 +1,127 @@
-+#ignore_file_errors=
-+#country_code=US
-+#ieee80211d=1
-+#ieee80211h=1
-+#hw_mode=g
-+#channel=7
-+#beacon_int=100
-+#rts_threshold=2347
-+#fragm_threshold=2346
-+#send_probe_response
-+#supported_rates=10 20 55 110 60 90 120 180 240 360 480 540
-+#basic_rates=10 20 55 110
-+#bridge_packets=1
-+#passive_scan_interval=60
-+#passive_scan_listen=10000
-+#passive_scan_mode=1
-+#ap_table_max_size=255
-+#ap_table_expiration_time=3600
-+interface=wlan0
-+#bridge=br0
-+driver=rtl8192cd
-+debug=4
-+logger_syslog_level=2
-+logger_stdout_level=2
-+logger_syslog=-1
-+logger_stdout=-1
-+dump_file=/tmp/hostapd.dump
-+ssid=hostapd_hcm
-+macaddr_acl=0
-+#accept_mac_file=/etc/hostapd.accept
-+#deny_mac_file=/etc/hostapd.deny
-+
-+#ap_max_inactivity=300
-+#assoc_ap_addr=
-+#ieee8021x=1
-+eapol_version=1
-+#eap_authenticator=
-+eap_server=0
-+#eap_user_file=/etc/hostapd.eap_user
-+#ca_cert=/etc/hostapd.ca.pem
-+#server_cert=/etc/hostapd.server.pem
-+#private_key=/etc/hostapd.server.prv
-+#private_key_passwd=secret passphrase
-+#check_crl=1
-+#eap_sim_db=unix:/tmp/hlr_auc_gw.sock
-+#eap_message=hello
-+#wep_key_len_broadcast=5
-+#wep_key_len_unicast=5
-+#wep_rekey_period=300
-+#eap_reauth_period=3600
-+eapol_key_index_workaround=0
-+#iapp_interface=eth0
-+own_ip_addr=192.168.1.254
-+#nas_identifier=ap.example.com
-+#auth_server_addr=192.168.1.188
-+#auth_server_port=1812
-+#auth_server_shared_secret=realtek_123
-+#acct_server_addr=192.168.1.188
-+#acct_server_port=1813
-+#acct_server_shared_secret=realtek_123
-+#radius_retry_primary_interval=600
-+#radius_acct_interim_interval=600
-+auth_algs=1
-+max_num_sta=32
-+wpa=1
-+wpa_group_rekey=86400
-+#wpa_strict_rekey=1
-+#wpa_gmk_rekey=86400
-+wpa_passphrase=1234567890
-+#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
-+#wpa_psk_file=/etc/hostapd.wpa_psk
-+wpa_key_mgmt=WPA-PSK
-+wpa_pairwise=TKIP CCMP
-+#rsn_preauth=1
-+#rsn_preauth_interfaces=eth0
-+#peerkey=1
-+ctrl_interface=/var/run/hostapd
-+ctrl_interface_group=0
-+#radius_server_clients=/etc/hostapd.radius_clients
-+#radius_server_auth_port=1812
-+#radius_server_ipv6=1
-+#test_socket=
-+#use_pae_group_addr=1
-+dtim_period=2
-+ignore_broadcast_ssid=0
-+#wep_default_key=0
-+#wep_key0=123456789a
-+#wep_key1="vwxyz"
-+#wep_key2=0102030405060708090a0b0c0d
-+#wep_key3=".2.4.6.8.0.23"
-+#dynamic_vlan=0
-+#vlan_file=/etc/hostapd.vlan
-+#vlan_tagged_interface=eht0
-+wme_enabled=1
-+#bssid=
-+#ieee80211w=0
-+#wps_disable=
-+#wps_upnp_disable=
-+#wps_version=
-+#wps_uuid=
-+#wps_auth_type_flags=
-+#wps_encr_type_flags=
-+#wps_conn_type_flags=
-+#wps_config_methods=
-+#wps_configured=
-+#wps_rf_bands=
-+#wps_default_pin=
-+#wps_default_timeout=
-+#wps_atheros_extension=
-+#wps_manufacturer=
-+#wps_model_name=
-+#wps_model_number=
-+#wps_serial_number=
-+#wps_friendly_name=
-+#wps_manufacturer_url=
-+#wps_model_description=
-+#wps_model_url=
-+#wps_upc_string=
-+#wps_dev_category=
-+#wps_dev_sub_category=
-+#wps_dev_oui=
-+#wps_dev_name=
-+#wps_os_version=
-+#wps_upnp_root_dir=
-+#wps_upnp_desc_url=
-+#nfc=0
-+#wps_helper=
-\ No newline at end of file
-Only in hostapd-rtk-0.6.10/hostapd/logwatch: hostapd
diff -purbB --unidirectional-new-file -x '.*' -x '*.o' hostapd-rtk-0.6.10/hostapd/Makefile hostapd-0.6.10/hostapd/Makefile
--- hostapd-rtk-0.6.10/hostapd/Makefile 2013-05-18 17:49:32.433577219 +0300
+++ hostapd-0.6.10/hostapd/Makefile 2013-05-02 01:48:29.296224179 +0300
@@ -147,14 +14,6 @@ diff -purbB --unidirectional-new-file -x '.*' -x '*.o' hostapd-rtk-0.6.10/hostap
# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
# a file (undefine it, if you want to save in binary size)
CFLAGS += -DHOSTAPD_DUMP_STATE
-Only in hostapd-rtk-0.6.10/: ipkg-realtek
-Only in hostapd-rtk-0.6.10/patches: 001-common-diff.patch
-Only in hostapd-rtk-0.6.10/patches: 002-common-files.patch
-Only in hostapd-rtk-0.6.10/patches: 003-hostapd-diff.patch
-Only in hostapd-rtk-0.6.10/patches: 004-hostapd-files.patch
-Only in hostapd-rtk-0.6.10/patches: 005-supplicant-diff.patch
-Only in hostapd-rtk-0.6.10/patches: 008-no-inband.patch
-Only in hostapd-rtk-0.6.10/patches: series
diff -purbB --unidirectional-new-file -x '.*' -x '*.o' hostapd-rtk-0.6.10/src/utils/os_unix.c hostapd-0.6.10/src/utils/os_unix.c
--- hostapd-rtk-0.6.10/src/utils/os_unix.c 2013-05-18 17:49:32.321577228 +0300
+++ hostapd-0.6.10/src/utils/os_unix.c 2013-05-02 01:48:29.767224141 +0300
@@ -182,82 +41,3 @@ diff -purbB --unidirectional-new-file -x '.*' -x '*.o' hostapd-rtk-0.6.10/src/ut
}
-diff -purbB --unidirectional-new-file -x '.*' -x '*.o' hostapd-rtk-0.6.10/wpa_supplicant/conf/wpa_supplicant.conf hostapd-0.6.10/wpa_supplicant/conf/wpa_supplicant.conf
---- hostapd-rtk-0.6.10/wpa_supplicant/conf/wpa_supplicant.conf 1970-01-01 03:00:00.000000000 +0300
-+++ hostapd-0.6.10/wpa_supplicant/conf/wpa_supplicant.conf 2013-05-02 01:48:29.781224140 +0300
-@@ -0,0 +1,75 @@
-+#update_config=1
-+ctrl_interface=/var/run/wpa_supplicant
-+eapol_version=1
-+ap_scan=1
-+fast_reauth=1
-+#opensc_engine_path=/usr/lib/opensc/engine_opensc.so
-+#pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
-+#pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
-+#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so
-+#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so
-+#driver_param="field=value"
-+
-+##=============================
-+##========RTK CONFIG===========
-+
-+## Physical band selection
-+## 0: SMSP
-+## 1: DMSP
-+## 2: DMDP
-+macPhyMode=0
-+
-+## Physical band selection
-+## BIT(0): 2.4G
-+## BIT(1): 5G
-+## If use iNIC-92C, use 2.4G only.
-+## If use iNIC-92D, whether set 2.4G or 5G, it will try to scan both 2.4G & 5G channels.
-+phyBandSelect=1
-+
-+##=============================
-+
-+#country=US
-+#dot11RSNAConfigPMKLifetime=43200
-+#dot11RSNAConfigPMKReauthThreshold=70
-+#dot11RSNAConfigSATimeout=60
-+#uuid=12345678-9abc-def0-1234-56789abcdef0
-+#device_name=Wireless Client
-+#manufacturer=Company
-+#model_name=cmodel
-+#model_number=123
-+#serial_number=12345
-+#device_type=1-0050F204-1
-+#os_version=01020300
-+#wps_cred_processing=0
-+
-+# Example blocks:
-+
-+# None Security
-+network={
-+ ssid="Realtek_AP_OPEN"
-+ key_mgmt=NONE
-+ priority=1
-+}
-+
-+
-+# Shared WEP key connection (no WPA, no IEEE 802.1X)
-+network={
-+ ssid="Realtek_AP_WEP"
-+ key_mgmt=NONE
-+ wep_key0="12345"
-+ wep_tx_keyidx=0
-+ priority=5
-+ auth_alg=SHARED
-+}
-+
-+
-+# Only WPA-PSK is used. Any valid cipher combination is accepted.
-+network={
-+ ssid="Realtek_AP_WPA"
-+ proto=WPA2
-+ key_mgmt=WPA-PSK
-+ pairwise=CCMP
-+ group=CCMP
-+ psk="1234567890123"
-+ priority=4
-+}
diff --git a/package/hostapd-rtk/patches/010-driver_realtek-fix-parse_pwrlevel.patch b/package/hostapd-rtk/patches/010-driver_realtek-fix-parse_pwrlevel.patch
new file mode 100644
index 000000000..cb21611da
--- /dev/null
+++ b/package/hostapd-rtk/patches/010-driver_realtek-fix-parse_pwrlevel.patch
@@ -0,0 +1,59 @@
+--- a/hostapd/driver_realtek.c 2014-03-12 00:25:49.638801019 +0200
++++ b/hostapd/driver_realtek.c 2014-03-12 00:27:12.958801997 +0200
+@@ -2538,43 +2538,24 @@
+
+ }
+
+-static int realtek_parse_pwrlevel(unsigned char* pwr_list, char *val)
++int realtek_parse_pwrlevel( unsigned char *dst, char *src )
+ {
+- int count;
+- char *pos, *end;
+-
+- pos = val;
+- count = 0;
+- while (*pos != '\0') {
+- if (*pos == ' ')
+- count++;
+- pos++;
++ char tmpbuf[4];
++ int len = strlen(src);
++ int bytes = 0;
++
++ while ( len > 0 ) {
++ memcpy( tmpbuf, src, 2 );
++ tmpbuf[2] = '\0';
++ *dst++ = (unsigned char)strtol( tmpbuf, NULL, 16 );
++ len -= 2;
++ src += 2;
++ bytes++;
+ }
+
+- pos = val;
+- count = 0;
+-
+- while (*pos != '\0') {
+- end = os_strchr(pos, ' ');
+- if (end)
+- *end = '\0';
+-
+- pwr_list[count] = atoi(pos);
+-
+- if (!end)
+- break;
+-
+- count ++;
+- if(count >=MAX_2G_CHANNEL_NUM)
+- break;
+-
+- pos = end + 1;
+- }
+-
+- return 0;
++ return bytes;
+ }
+
+-
+ static int realtek_read_hapd_cfg(struct hostapd_data *hapd,void *priv, struct rtk_hapd_config* config)
+ {
+ struct realtek_driver_data *drv = priv;