Commit f301ed39fc48cbcfa558da468e6557aa0b8b73d6

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

First commit - working all configurations for AP

setup-wlan.py
... ... @@ -17,7 +17,8 @@ peers_file_path = str(sys.argv[2])
17 17 ap_addr, bssid, rate, mac_ap, power, channel, video_nodes, data_nodes, mechanism = utils_config.get_config_from_json(config_file_path)
18 18 # Remove M from rate (Ej: 24M -> 24)
19 19 rate = rate[:-1]
20   -
  20 +b_size = 0
  21 +retries = 0
21 22 # Check selected mechanism and get extra data if needed
22 23 if utils_config.check_mechanism(mechanism) == "not_valid":
23 24 print "Mechanism not supported"
... ... @@ -37,7 +38,7 @@ if video_nodes > 0:
37 38 sys.exit()
38 39 else:
39 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 42 utils_ap.start_ap(ap_addr, wlan0_ip, rate, channel, power)
42 43  
43 44 # Check ap configuration
... ...
utils_ap.py
... ... @@ -4,7 +4,7 @@ import utils_config ## incluse ssh command execution method
4 4 # Global variables
5 5 path_module_b43 = "/lib/modules/2.6.36/kernel/drivers/net/wireless"
6 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 9 # Get ap data from peers file
10 10 # - Input: Path to peers file and wired ip where AP is located
... ... @@ -47,18 +47,18 @@ def reload_ap(ap_addr):
47 47  
48 48 # Enable the required modules according to the selected mechanism
49 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 51 print "Mechanism %s selected for the AP. Loading modules ..." % mechanism
52 52  
53 53 if mechanism == "BLOCK_ACK":
54   - set_block_ack(rate, b_size)
  54 + set_block_ack(ap_addr, rate, b_size)
55 55 elif mechanism == "DMS":
56 56 set_dms()
57 57 elif mechanism == "UR":
58 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 62 # Check if all the configuration is correctly set
63 63 # - Input: AP address
64 64 def check_ap(ap_addr, wlan0_ip):
... ... @@ -82,7 +82,7 @@ def set_block_ack(ap_addr, rate, b_size):
82 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 83 # DMA
84 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 86 # END DMA
87 87  
88 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 108 utils_config.exec_command_ssh(ap_addr, "rm /lib/firmware/b43.video/firmware.ur/ucode5.fw")
109 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 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 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