blob: b9aeebc80a7496402a07f9bc420489d1fb0b2c71 [file] [log] [blame]
Jouni Malinencd4e3c32015-10-29 12:39:56 +02001#!/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
8import subprocess,sys
9import re
10
11dest_mac = sys.argv[1]
12agg_size = sys.argv[2]
13mac = re.escape(dest_mac)
14
15debugfs_path = subprocess.check_output(['sudo','find','/sys/kernel/debug/ieee80211','-name','wil6210'])
16debugfs_path = debugfs_path.rstrip()
17vrings_file = debugfs_path + '/vrings'
18print vrings_file
19vrings = open(vrings_file,'r')
20#vrings = open('/home/wigig/work/vrings_example.txt','r')
21
22#print vrings.name
23line1 = vrings.readline()
24while 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
31if 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
44sys.exit(1)