debug.c (fce041beb03f93c7a771f0b4b6c45bb71ef90901) | debug.c (05c0be2f7f10404e5b3bc4105f9206096e9b8767) |
---|---|
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 --- 162 unchanged lines hidden (view full) --- 171static const struct file_operations fops_rx_chainmask = { 172 .read = read_file_rx_chainmask, 173 .write = write_file_rx_chainmask, 174 .open = ath9k_debugfs_open, 175 .owner = THIS_MODULE, 176 .llseek = default_llseek, 177}; 178 | 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 --- 162 unchanged lines hidden (view full) --- 171static const struct file_operations fops_rx_chainmask = { 172 .read = read_file_rx_chainmask, 173 .write = write_file_rx_chainmask, 174 .open = ath9k_debugfs_open, 175 .owner = THIS_MODULE, 176 .llseek = default_llseek, 177}; 178 |
179static ssize_t read_file_disable_ani(struct file *file, char __user *user_buf, 180 size_t count, loff_t *ppos) 181{ 182 struct ath_softc *sc = file->private_data; 183 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 184 char buf[32]; 185 unsigned int len; |
|
179 | 186 |
187 len = sprintf(buf, "%d\n", common->disable_ani); 188 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 189} 190 191static ssize_t write_file_disable_ani(struct file *file, 192 const char __user *user_buf, 193 size_t count, loff_t *ppos) 194{ 195 struct ath_softc *sc = file->private_data; 196 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 197 unsigned long disable_ani; 198 char buf[32]; 199 ssize_t len; 200 201 len = min(count, sizeof(buf) - 1); 202 if (copy_from_user(buf, user_buf, len)) 203 return -EFAULT; 204 205 buf[len] = '\0'; 206 if (strict_strtoul(buf, 0, &disable_ani)) 207 return -EINVAL; 208 209 common->disable_ani = !!disable_ani; 210 211 if (disable_ani) { 212 sc->sc_flags &= ~SC_OP_ANI_RUN; 213 del_timer_sync(&common->ani.timer); 214 } else { 215 sc->sc_flags |= SC_OP_ANI_RUN; 216 ath_start_ani(common); 217 } 218 219 return count; 220} 221 222static const struct file_operations fops_disable_ani = { 223 .read = read_file_disable_ani, 224 .write = write_file_disable_ani, 225 .open = ath9k_debugfs_open, 226 .owner = THIS_MODULE, 227 .llseek = default_llseek, 228}; 229 |
|
180static ssize_t read_file_dma(struct file *file, char __user *user_buf, 181 size_t count, loff_t *ppos) 182{ 183 struct ath_softc *sc = file->private_data; 184 struct ath_hw *ah = sc->sc_ah; 185 char *buf; 186 int retval; 187 unsigned int len = 0; --- 966 unchanged lines hidden (view full) --- 1154 debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, 1155 &fops_misc); 1156 debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc, 1157 &fops_recv); 1158 debugfs_create_file("rx_chainmask", S_IRUSR | S_IWUSR, 1159 sc->debug.debugfs_phy, sc, &fops_rx_chainmask); 1160 debugfs_create_file("tx_chainmask", S_IRUSR | S_IWUSR, 1161 sc->debug.debugfs_phy, sc, &fops_tx_chainmask); | 230static ssize_t read_file_dma(struct file *file, char __user *user_buf, 231 size_t count, loff_t *ppos) 232{ 233 struct ath_softc *sc = file->private_data; 234 struct ath_hw *ah = sc->sc_ah; 235 char *buf; 236 int retval; 237 unsigned int len = 0; --- 966 unchanged lines hidden (view full) --- 1204 debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, 1205 &fops_misc); 1206 debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc, 1207 &fops_recv); 1208 debugfs_create_file("rx_chainmask", S_IRUSR | S_IWUSR, 1209 sc->debug.debugfs_phy, sc, &fops_rx_chainmask); 1210 debugfs_create_file("tx_chainmask", S_IRUSR | S_IWUSR, 1211 sc->debug.debugfs_phy, sc, &fops_tx_chainmask); |
1212 debugfs_create_file("disable_ani", S_IRUSR | S_IWUSR, 1213 sc->debug.debugfs_phy, sc, &fops_disable_ani); |
|
1162 debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1163 sc, &fops_regidx); 1164 debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1165 sc, &fops_regval); 1166 debugfs_create_bool("ignore_extcca", S_IRUSR | S_IWUSR, 1167 sc->debug.debugfs_phy, 1168 &ah->config.cwm_ignore_extcca); 1169 debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc, 1170 &fops_regdump); 1171 1172 debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR, 1173 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); 1174 1175 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR, 1176 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); 1177 1178 sc->debug.regidx = 0; 1179 return 0; 1180} | 1214 debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1215 sc, &fops_regidx); 1216 debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1217 sc, &fops_regval); 1218 debugfs_create_bool("ignore_extcca", S_IRUSR | S_IWUSR, 1219 sc->debug.debugfs_phy, 1220 &ah->config.cwm_ignore_extcca); 1221 debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc, 1222 &fops_regdump); 1223 1224 debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR, 1225 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); 1226 1227 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR, 1228 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); 1229 1230 sc->debug.regidx = 0; 1231 return 0; 1232} |