aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/debug.c
diff options
context:
space:
mode:
authorRishi Panjwani <rpanjwan@qca.qualcomm.com>2011-10-14 20:48:07 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:50:57 -0500
commit8fffd9e5ec9ea046ff45c7974395ffbcb4bbef14 (patch)
tree7c505800babc41fd12f88951c085f57673eefd87 /drivers/net/wireless/ath/ath6kl/debug.c
parent171693292ec733ecb96734370ddfe0d9f73e920f (diff)
ath6kl: Implement support for QOS-enable and QOS-disable from userspace
In order to allow user space based QOS control we use the available debugfs infrastructure. With this feature, user can make changes to qos parameters, thereby allowing creation and deletion of user defined priority streams and features like uapsd. This feature has been added for testing purposes. All 21 parameters for the create_qos command are mandatory in the correct order. They have to be written to the create_qos file in the ath6kl debug directory. These parameters(in order) are: 1)user priority 2)direction 3)traffic class 4)traffic type 5)voice PS capability 6)min service intvl 7)max service intvl 8)inactivity intvl 9)suspension intvl 10)serv start time 11)tsid 12)nominal msdu 13)max msdu 14)min data rate 15)mean data rate 16)peak data rate 17)max burst size 18)delay bound 19)min phy rate 20)surplus bw allowance 21)medium time To create a qos stream: echo "6 2 3 1 1 9999999 9999999 9999999 7777777 0 6 45000 200 56789000 56789000 5678900 0 0 9999999 20000 0" > create_qos delete_qos requires 2 parameters: 1)traffic class 2)tsid To delete a qos stream: echo "3 1" > delete_qos kvalo: minor commit log cleanup Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.c220
1 files changed, 220 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index dd377852a0ba..460f211bb40c 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -1240,6 +1240,220 @@ static const struct file_operations fops_disconnect_timeout = {
1240 .llseek = default_llseek, 1240 .llseek = default_llseek,
1241}; 1241};
1242 1242
1243static ssize_t ath6kl_create_qos_write(struct file *file,
1244 const char __user *user_buf,
1245 size_t count, loff_t *ppos)
1246{
1247
1248 struct ath6kl *ar = file->private_data;
1249 char buf[100];
1250 ssize_t len;
1251 char *sptr, *token;
1252 struct wmi_create_pstream_cmd pstream;
1253 u32 val32;
1254 u16 val16;
1255
1256 len = min(count, sizeof(buf) - 1);
1257 if (copy_from_user(buf, user_buf, len))
1258 return -EFAULT;
1259 buf[len] = '\0';
1260 sptr = buf;
1261
1262 token = strsep(&sptr, " ");
1263 if (!token)
1264 return -EINVAL;
1265 if (kstrtou8(token, 0, &pstream.user_pri))
1266 return -EINVAL;
1267
1268 token = strsep(&sptr, " ");
1269 if (!token)
1270 return -EINVAL;
1271 if (kstrtou8(token, 0, &pstream.traffic_direc))
1272 return -EINVAL;
1273
1274 token = strsep(&sptr, " ");
1275 if (!token)
1276 return -EINVAL;
1277 if (kstrtou8(token, 0, &pstream.traffic_class))
1278 return -EINVAL;
1279
1280 token = strsep(&sptr, " ");
1281 if (!token)
1282 return -EINVAL;
1283 if (kstrtou8(token, 0, &pstream.traffic_type))
1284 return -EINVAL;
1285
1286 token = strsep(&sptr, " ");
1287 if (!token)
1288 return -EINVAL;
1289 if (kstrtou8(token, 0, &pstream.voice_psc_cap))
1290 return -EINVAL;
1291
1292 token = strsep(&sptr, " ");
1293 if (!token)
1294 return -EINVAL;
1295 if (kstrtou32(token, 0, &val32))
1296 return -EINVAL;
1297 pstream.min_service_int = cpu_to_le32(val32);
1298
1299 token = strsep(&sptr, " ");
1300 if (!token)
1301 return -EINVAL;
1302 if (kstrtou32(token, 0, &val32))
1303 return -EINVAL;
1304 pstream.max_service_int = cpu_to_le32(val32);
1305
1306 token = strsep(&sptr, " ");
1307 if (!token)
1308 return -EINVAL;
1309 if (kstrtou32(token, 0, &val32))
1310 return -EINVAL;
1311 pstream.inactivity_int = cpu_to_le32(val32);
1312
1313 token = strsep(&sptr, " ");
1314 if (!token)
1315 return -EINVAL;
1316 if (kstrtou32(token, 0, &val32))
1317 return -EINVAL;
1318 pstream.suspension_int = cpu_to_le32(val32);
1319
1320 token = strsep(&sptr, " ");
1321 if (!token)
1322 return -EINVAL;
1323 if (kstrtou32(token, 0, &val32))
1324 return -EINVAL;
1325 pstream.service_start_time = cpu_to_le32(val32);
1326
1327 token = strsep(&sptr, " ");
1328 if (!token)
1329 return -EINVAL;
1330 if (kstrtou8(token, 0, &pstream.tsid))
1331 return -EINVAL;
1332
1333 token = strsep(&sptr, " ");
1334 if (!token)
1335 return -EINVAL;
1336 if (kstrtou16(token, 0, &val16))
1337 return -EINVAL;
1338 pstream.nominal_msdu = cpu_to_le16(val16);
1339
1340 token = strsep(&sptr, " ");
1341 if (!token)
1342 return -EINVAL;
1343 if (kstrtou16(token, 0, &val16))
1344 return -EINVAL;
1345 pstream.max_msdu = cpu_to_le16(val16);
1346
1347 token = strsep(&sptr, " ");
1348 if (!token)
1349 return -EINVAL;
1350 if (kstrtou32(token, 0, &val32))
1351 return -EINVAL;
1352 pstream.min_data_rate = cpu_to_le32(val32);
1353
1354 token = strsep(&sptr, " ");
1355 if (!token)
1356 return -EINVAL;
1357 if (kstrtou32(token, 0, &val32))
1358 return -EINVAL;
1359 pstream.mean_data_rate = cpu_to_le32(val32);
1360
1361 token = strsep(&sptr, " ");
1362 if (!token)
1363 return -EINVAL;
1364 if (kstrtou32(token, 0, &val32))
1365 return -EINVAL;
1366 pstream.peak_data_rate = cpu_to_le32(val32);
1367
1368 token = strsep(&sptr, " ");
1369 if (!token)
1370 return -EINVAL;
1371 if (kstrtou32(token, 0, &val32))
1372 return -EINVAL;
1373 pstream.max_burst_size = cpu_to_le32(val32);
1374
1375 token = strsep(&sptr, " ");
1376 if (!token)
1377 return -EINVAL;
1378 if (kstrtou32(token, 0, &val32))
1379 return -EINVAL;
1380 pstream.delay_bound = cpu_to_le32(val32);
1381
1382 token = strsep(&sptr, " ");
1383 if (!token)
1384 return -EINVAL;
1385 if (kstrtou32(token, 0, &val32))
1386 return -EINVAL;
1387 pstream.min_phy_rate = cpu_to_le32(val32);
1388
1389 token = strsep(&sptr, " ");
1390 if (!token)
1391 return -EINVAL;
1392 if (kstrtou32(token, 0, &val32))
1393 return -EINVAL;
1394 pstream.sba = cpu_to_le32(val32);
1395
1396 token = strsep(&sptr, " ");
1397 if (!token)
1398 return -EINVAL;
1399 if (kstrtou32(token, 0, &val32))
1400 return -EINVAL;
1401 pstream.medium_time = cpu_to_le32(val32);
1402
1403 ath6kl_wmi_create_pstream_cmd(ar->wmi, &pstream);
1404
1405 return count;
1406}
1407
1408static const struct file_operations fops_create_qos = {
1409 .write = ath6kl_create_qos_write,
1410 .open = ath6kl_debugfs_open,
1411 .owner = THIS_MODULE,
1412 .llseek = default_llseek,
1413};
1414
1415static ssize_t ath6kl_delete_qos_write(struct file *file,
1416 const char __user *user_buf,
1417 size_t count, loff_t *ppos)
1418{
1419
1420 struct ath6kl *ar = file->private_data;
1421 char buf[100];
1422 ssize_t len;
1423 char *sptr, *token;
1424 u8 traffic_class;
1425 u8 tsid;
1426
1427 len = min(count, sizeof(buf) - 1);
1428 if (copy_from_user(buf, user_buf, len))
1429 return -EFAULT;
1430 buf[len] = '\0';
1431 sptr = buf;
1432
1433 token = strsep(&sptr, " ");
1434 if (!token)
1435 return -EINVAL;
1436 if (kstrtou8(token, 0, &traffic_class))
1437 return -EINVAL;
1438
1439 token = strsep(&sptr, " ");
1440 if (!token)
1441 return -EINVAL;
1442 if (kstrtou8(token, 0, &tsid))
1443 return -EINVAL;
1444
1445 ath6kl_wmi_delete_pstream_cmd(ar->wmi, traffic_class, tsid);
1446
1447 return count;
1448}
1449
1450static const struct file_operations fops_delete_qos = {
1451 .write = ath6kl_delete_qos_write,
1452 .open = ath6kl_debugfs_open,
1453 .owner = THIS_MODULE,
1454 .llseek = default_llseek,
1455};
1456
1243int ath6kl_debug_init(struct ath6kl *ar) 1457int ath6kl_debug_init(struct ath6kl *ar)
1244{ 1458{
1245 ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE); 1459 ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE);
@@ -1313,6 +1527,12 @@ int ath6kl_debug_init(struct ath6kl *ar)
1313 debugfs_create_file("disconnect_timeout", S_IRUSR | S_IWUSR, 1527 debugfs_create_file("disconnect_timeout", S_IRUSR | S_IWUSR,
1314 ar->debugfs_phy, ar, &fops_disconnect_timeout); 1528 ar->debugfs_phy, ar, &fops_disconnect_timeout);
1315 1529
1530 debugfs_create_file("create_qos", S_IWUSR, ar->debugfs_phy, ar,
1531 &fops_create_qos);
1532
1533 debugfs_create_file("delete_qos", S_IWUSR, ar->debugfs_phy, ar,
1534 &fops_delete_qos);
1535
1316 return 0; 1536 return 0;
1317} 1537}
1318 1538