debug.c (91d57de5adfc40184ef7cb8974104459c5211add) debug.c (e5090444be811ce45653969363be8fcb4c52d597)
1/*
2 * Copyright (c) 2004-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

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

709static const struct file_operations fops_reg_dump = {
710 .open = ath6kl_regdump_open,
711 .read = ath6kl_regdump_read,
712 .release = ath6kl_regdump_release,
713 .owner = THIS_MODULE,
714 .llseek = default_llseek,
715};
716
1/*
2 * Copyright (c) 2004-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

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

709static const struct file_operations fops_reg_dump = {
710 .open = ath6kl_regdump_open,
711 .read = ath6kl_regdump_read,
712 .release = ath6kl_regdump_release,
713 .owner = THIS_MODULE,
714 .llseek = default_llseek,
715};
716
717static ssize_t ath6kl_lrssi_roam_write(struct file *file,
718 const char __user *user_buf,
719 size_t count, loff_t *ppos)
720{
721 struct ath6kl *ar = file->private_data;
722 unsigned long lrssi_roam_threshold;
723 char buf[32];
724 ssize_t len;
725
726 len = min(count, sizeof(buf) - 1);
727 if (copy_from_user(buf, user_buf, len))
728 return -EFAULT;
729
730 buf[len] = '\0';
731 if (strict_strtoul(buf, 0, &lrssi_roam_threshold))
732 return -EINVAL;
733
734 ar->lrssi_roam_threshold = lrssi_roam_threshold;
735
736 ath6kl_wmi_set_roam_lrssi_cmd(ar->wmi, ar->lrssi_roam_threshold);
737
738 return count;
739}
740
741static ssize_t ath6kl_lrssi_roam_read(struct file *file,
742 char __user *user_buf,
743 size_t count, loff_t *ppos)
744{
745 struct ath6kl *ar = file->private_data;
746 char buf[32];
747 unsigned int len;
748
749 len = snprintf(buf, sizeof(buf), "%u\n", ar->lrssi_roam_threshold);
750
751 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
752}
753
754static const struct file_operations fops_lrssi_roam_threshold = {
755 .read = ath6kl_lrssi_roam_read,
756 .write = ath6kl_lrssi_roam_write,
757 .open = ath6kl_debugfs_open,
758 .owner = THIS_MODULE,
759 .llseek = default_llseek,
760};
761
717int ath6kl_debug_init(struct ath6kl *ar)
718{
719 ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE);
720 if (ar->debug.fwlog_buf.buf == NULL)
721 return -ENOMEM;
722
723 ar->debug.fwlog_tmp = kmalloc(ATH6KL_FWLOG_SLOT_SIZE, GFP_KERNEL);
724 if (ar->debug.fwlog_tmp == NULL) {

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

755 ar, &fops_fwlog_mask);
756
757 debugfs_create_file("reg_addr", S_IRUSR | S_IWUSR, ar->debugfs_phy, ar,
758 &fops_diag_reg_read);
759
760 debugfs_create_file("reg_dump", S_IRUSR, ar->debugfs_phy, ar,
761 &fops_reg_dump);
762
762int ath6kl_debug_init(struct ath6kl *ar)
763{
764 ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE);
765 if (ar->debug.fwlog_buf.buf == NULL)
766 return -ENOMEM;
767
768 ar->debug.fwlog_tmp = kmalloc(ATH6KL_FWLOG_SLOT_SIZE, GFP_KERNEL);
769 if (ar->debug.fwlog_tmp == NULL) {

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

800 ar, &fops_fwlog_mask);
801
802 debugfs_create_file("reg_addr", S_IRUSR | S_IWUSR, ar->debugfs_phy, ar,
803 &fops_diag_reg_read);
804
805 debugfs_create_file("reg_dump", S_IRUSR, ar->debugfs_phy, ar,
806 &fops_reg_dump);
807
808 debugfs_create_file("lrssi_roam_threshold", S_IRUSR | S_IWUSR,
809 ar->debugfs_phy, ar, &fops_lrssi_roam_threshold);
763 return 0;
764}
765
766void ath6kl_debug_cleanup(struct ath6kl *ar)
767{
768 vfree(ar->debug.fwlog_buf.buf);
769 kfree(ar->debug.fwlog_tmp);
770}
771
772#endif
810 return 0;
811}
812
813void ath6kl_debug_cleanup(struct ath6kl *ar)
814{
815 vfree(ar->debug.fwlog_buf.buf);
816 kfree(ar->debug.fwlog_tmp);
817}
818
819#endif