debug.c (2fe5de9ce7d57498abc14b375cad2fcf8c3ee6cc) debug.c (f2c3c952a5966e734f600e772ed65b5d34033891)
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 1282 unchanged lines hidden (view full) ---

1291
1292static const struct file_operations fops_base_eeprom = {
1293 .read = read_file_base_eeprom,
1294 .open = simple_open,
1295 .owner = THIS_MODULE,
1296 .llseek = default_llseek,
1297};
1298
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 1282 unchanged lines hidden (view full) ---

1291
1292static const struct file_operations fops_base_eeprom = {
1293 .read = read_file_base_eeprom,
1294 .open = simple_open,
1295 .owner = THIS_MODULE,
1296 .llseek = default_llseek,
1297};
1298
1299static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf,
1300 size_t count, loff_t *ppos)
1301{
1302 struct ath_softc *sc = file->private_data;
1303 struct ath_hw *ah = sc->sc_ah;
1304 u32 len = 0, size = 6000;
1305 char *buf;
1306 size_t retval;
1307
1308 buf = kzalloc(size, GFP_KERNEL);
1309 if (buf == NULL)
1310 return -ENOMEM;
1311
1312 len = ah->eep_ops->dump_eeprom(ah, false, buf, len, size);
1313
1314 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
1315 kfree(buf);
1316
1317 return retval;
1318}
1319
1320static const struct file_operations fops_modal_eeprom = {
1321 .read = read_file_modal_eeprom,
1322 .open = simple_open,
1323 .owner = THIS_MODULE,
1324 .llseek = default_llseek,
1325};
1326
1327#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1328static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
1329 size_t count, loff_t *ppos)
1330{
1331 struct ath_softc *sc = file->private_data;
1332 u32 len = 0, size = 1500;
1333 char *buf;
1334 size_t retval;

--- 209 unchanged lines hidden (view full) ---

1544 sc->debug.debugfs_phy,
1545 &ah->config.cwm_ignore_extcca);
1546 debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc,
1547 &fops_regdump);
1548 debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc,
1549 &fops_dump_nfcal);
1550 debugfs_create_file("base_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
1551 &fops_base_eeprom);
1299#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1300static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
1301 size_t count, loff_t *ppos)
1302{
1303 struct ath_softc *sc = file->private_data;
1304 u32 len = 0, size = 1500;
1305 char *buf;
1306 size_t retval;

--- 209 unchanged lines hidden (view full) ---

1516 sc->debug.debugfs_phy,
1517 &ah->config.cwm_ignore_extcca);
1518 debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc,
1519 &fops_regdump);
1520 debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc,
1521 &fops_dump_nfcal);
1522 debugfs_create_file("base_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
1523 &fops_base_eeprom);
1552 debugfs_create_file("modal_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
1553 &fops_modal_eeprom);
1524
1525 ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
1526
1554 debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
1555 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
1556 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
1557 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
1558 debugfs_create_file("antenna_diversity", S_IRUSR,
1559 sc->debug.debugfs_phy, sc, &fops_antenna_diversity);
1560#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1561 debugfs_create_file("bt_ant_diversity", S_IRUSR | S_IWUSR,
1562 sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity);
1563 debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
1564 &fops_btcoex);
1565#endif
1566
1567 return 0;
1568}
1527 debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
1528 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
1529 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
1530 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
1531 debugfs_create_file("antenna_diversity", S_IRUSR,
1532 sc->debug.debugfs_phy, sc, &fops_antenna_diversity);
1533#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1534 debugfs_create_file("bt_ant_diversity", S_IRUSR | S_IWUSR,
1535 sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity);
1536 debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
1537 &fops_btcoex);
1538#endif
1539
1540 return 0;
1541}