Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | # |
| 3 | # Sigma Control API DUT (wil6210_addba_req) |
| 4 | # Copyright (c) 2015, Qualcomm Atheros, Inc. |
| 5 | # All Rights Reserved. |
| 6 | # Licensed under the Clear BSD license. See README for more details. |
| 7 | |
| 8 | import subprocess,sys |
| 9 | import re |
| 10 | |
| 11 | dest_mac = sys.argv[1] |
| 12 | agg_size = sys.argv[2] |
| 13 | mac = re.escape(dest_mac) |
| 14 | |
| 15 | debugfs_path = subprocess.check_output(['sudo','find','/sys/kernel/debug/ieee80211','-name','wil6210']) |
| 16 | debugfs_path = debugfs_path.rstrip() |
| 17 | vrings_file = debugfs_path + '/vrings' |
| 18 | print vrings_file |
| 19 | vrings = open(vrings_file,'r') |
| 20 | #vrings = open('/home/wigig/work/vrings_example.txt','r') |
| 21 | |
| 22 | #print vrings.name |
| 23 | line1 = vrings.readline() |
| 24 | while line1: |
| 25 | match = re.match(mac,line1) |
| 26 | if (match is not None): |
| 27 | # print "I found the requested MAC\n" |
| 28 | break |
| 29 | line1 = vrings.readline() |
| 30 | |
| 31 | if line1: |
| 32 | vring_line = vrings.readline() |
| 33 | # print "the next vring_line is",vring_line |
| 34 | match = re.match(r'VRING tx_ (\d+)',vring_line) |
| 35 | if match is not None: |
| 36 | vring_id = match.group(1) |
| 37 | back_file = debugfs_path+"/back" |
| 38 | addba_cmd = "sudo echo \"add {} {}\" > {}".format(vring_id,agg_size,back_file) |
| 39 | print "addba command is:", addba_cmd |
| 40 | #echo "add 0 11" > /sys/kernel/debug/ieee80211/phy26/wil6210/back |
| 41 | ret = subprocess.call(addba_cmd, shell=True) |
| 42 | sys.exit(ret) |
| 43 | |
| 44 | sys.exit(1) |