Commit f301ed39fc48cbcfa558da468e6557aa0b8b73d6

Authored by Ginés García
1 parent 4849bab4

First commit - working all configurations for AP

@@ -17,7 +17,8 @@ peers_file_path = str(sys.argv[2]) @@ -17,7 +17,8 @@ peers_file_path = str(sys.argv[2])
17 ap_addr, bssid, rate, mac_ap, power, channel, video_nodes, data_nodes, mechanism = utils_config.get_config_from_json(config_file_path) 17 ap_addr, bssid, rate, mac_ap, power, channel, video_nodes, data_nodes, mechanism = utils_config.get_config_from_json(config_file_path)
18 # Remove M from rate (Ej: 24M -> 24) 18 # Remove M from rate (Ej: 24M -> 24)
19 rate = rate[:-1] 19 rate = rate[:-1]
20 - 20 +b_size = 0
  21 +retries = 0
21 # Check selected mechanism and get extra data if needed 22 # Check selected mechanism and get extra data if needed
22 if utils_config.check_mechanism(mechanism) == "not_valid": 23 if utils_config.check_mechanism(mechanism) == "not_valid":
23 print "Mechanism not supported" 24 print "Mechanism not supported"
@@ -37,7 +38,7 @@ if video_nodes > 0: @@ -37,7 +38,7 @@ if video_nodes > 0:
37 sys.exit() 38 sys.exit()
38 else: 39 else:
39 utils_ap.reload_ap(ap_addr) 40 utils_ap.reload_ap(ap_addr)
40 - utils_ap.set_mechanism(ap_addr, mechanism) 41 + utils_ap.set_mechanism(ap_addr, mechanism, rate, b_size, retries)
41 utils_ap.start_ap(ap_addr, wlan0_ip, rate, channel, power) 42 utils_ap.start_ap(ap_addr, wlan0_ip, rate, channel, power)
42 43
43 # Check ap configuration 44 # Check ap configuration
@@ -4,7 +4,7 @@ import utils_config ## incluse ssh command execution method @@ -4,7 +4,7 @@ import utils_config ## incluse ssh command execution method
4 # Global variables 4 # Global variables
5 path_module_b43 = "/lib/modules/2.6.36/kernel/drivers/net/wireless" 5 path_module_b43 = "/lib/modules/2.6.36/kernel/drivers/net/wireless"
6 path_module_80211 = "/lib/modules/2.6.36/kernel/net/mac80211" 6 path_module_80211 = "/lib/modules/2.6.36/kernel/net/mac80211"
7 -path_firm_b43_blockack = /lib/firmware/b43.video/firmware.blockack 7 +path_firm_b43_blockack = "/lib/firmware/b43.video/firmware.blockack"
8 8
9 # Get ap data from peers file 9 # Get ap data from peers file
10 # - Input: Path to peers file and wired ip where AP is located 10 # - Input: Path to peers file and wired ip where AP is located
@@ -47,18 +47,18 @@ def reload_ap(ap_addr): @@ -47,18 +47,18 @@ def reload_ap(ap_addr):
47 47
48 # Enable the required modules according to the selected mechanism 48 # Enable the required modules according to the selected mechanism
49 # - Input: AP address, mechanism and rate. In addition b_size or retries if mechanism is BLOCK_ACK or UR 49 # - Input: AP address, mechanism and rate. In addition b_size or retries if mechanism is BLOCK_ACK or UR
50 -def set_mechanism(ap_addr, mechanism, rate, b_size): 50 +def set_mechanism(ap_addr, mechanism, rate, b_size, retries):
51 print "Mechanism %s selected for the AP. Loading modules ..." % mechanism 51 print "Mechanism %s selected for the AP. Loading modules ..." % mechanism
52 52
53 if mechanism == "BLOCK_ACK": 53 if mechanism == "BLOCK_ACK":
54 - set_block_ack(rate, b_size) 54 + set_block_ack(ap_addr, rate, b_size)
55 elif mechanism == "DMS": 55 elif mechanism == "DMS":
56 set_dms() 56 set_dms()
57 elif mechanism == "UR": 57 elif mechanism == "UR":
58 set_ur(ap_addr, rate, retries) 58 set_ur(ap_addr, rate, retries)
59 - elif mechanism == "LEGACY"  
60 -  
61 - 59 + elif mechanism == "LEGACY":
  60 + set_legacy(ap_addr, rate)
  61 +
62 # Check if all the configuration is correctly set 62 # Check if all the configuration is correctly set
63 # - Input: AP address 63 # - Input: AP address
64 def check_ap(ap_addr, wlan0_ip): 64 def check_ap(ap_addr, wlan0_ip):
@@ -82,7 +82,7 @@ def set_block_ack(ap_addr, rate, b_size): @@ -82,7 +82,7 @@ def set_block_ack(ap_addr, rate, b_size):
82 utils_config.exec_command("cp %s/%s/ucode5.back-%s.fw %s/ucode5.fw" % (path_firm_b43_blockack, rate, b_size, path_firm_b43_blockack)) 82 utils_config.exec_command("cp %s/%s/ucode5.back-%s.fw %s/ucode5.fw" % (path_firm_b43_blockack, rate, b_size, path_firm_b43_blockack))
83 # DMA 83 # DMA
84 #utils_config.exec_command_ssh(ap_addr, ("cp %s/%s/ucode5.back-%s.fw.dma %s/ucode5.fw" % (path_firm_b43_blockack, rate, b_size, path_firm_b43_blockack))) 84 #utils_config.exec_command_ssh(ap_addr, ("cp %s/%s/ucode5.back-%s.fw.dma %s/ucode5.fw" % (path_firm_b43_blockack, rate, b_size, path_firm_b43_blockack)))
85 - utils_config.exec_command_ssh(ap_addr, "cp %s/%s/ucode5.back-%s.fw %s/ucode5.fw" % path_firm_b43_blockack, rate, b_size path_firm_b43_blockack)) 85 + utils_config.exec_command_ssh(ap_addr, "cp %s/%s/ucode5.back-%s.fw %s/ucode5.fw" % (path_firm_b43_blockack, rate, b_size, path_firm_b43_blockack))
86 # END DMA 86 # END DMA
87 87
88 utils_config.exec_command_ssh(ap_addr, "ln -s %s /lib/firmware/b43" % path_firm_b43_blockack) 88 utils_config.exec_command_ssh(ap_addr, "ln -s %s /lib/firmware/b43" % path_firm_b43_blockack)
@@ -108,7 +108,7 @@ def set_ur(ap_addr, rate, retries): @@ -108,7 +108,7 @@ def set_ur(ap_addr, rate, retries):
108 utils_config.exec_command_ssh(ap_addr, "rm /lib/firmware/b43.video/firmware.ur/ucode5.fw") 108 utils_config.exec_command_ssh(ap_addr, "rm /lib/firmware/b43.video/firmware.ur/ucode5.fw")
109 utils_config.exec_command_ssh(ap_addr, "ln -s /lib/firmware/b43.video/firmware.ur/ucode5.ur-%s.fw /lib/firmware/b43/ucode5.fw" % retries) 109 utils_config.exec_command_ssh(ap_addr, "ln -s /lib/firmware/b43.video/firmware.ur/ucode5.ur-%s.fw /lib/firmware/b43/ucode5.fw" % retries)
110 utils_config.exec_command_ssh(ap_addr, "ln -s %s/b43/b43.ur.ko %s/b43/b43.ko" % (path_module_b43, path_module_b43)) 110 utils_config.exec_command_ssh(ap_addr, "ln -s %s/b43/b43.ur.ko %s/b43/b43.ko" % (path_module_b43, path_module_b43))
111 - utils_config.exec_command_ssh(ap_addr, "modprobe b43 qos=1 brate=rate && sleep 0.5" % rate) 111 + utils_config.exec_command_ssh(ap_addr, "modprobe b43 qos=1 brate=%s && sleep 0.5" % rate)
112 112
113 113
114 # Load modules in order to enable LEGACY mechanism 114 # Load modules in order to enable LEGACY mechanism
utils_ap.pyc
No preview for this file type
utils_config.pyc
No preview for this file type
utils_peers.pyc
No preview for this file type