Lines Matching +full:tx +full:- +full:d +full:- +full:cal

1 // SPDX-License-Identifier: GPL-2.0-or-later
8 Copyright (c) 2005-2007 Michael Buesch <m@bues.ch>
44 p = dev->dfsentry; in fops_to_dfs_file()
45 p += dfops->file_struct_offset; in fops_to_dfs_file()
53 if (bufsize - count) \
55 bufsize - count, \
73 routing = dev->dfsentry->shm16read_routing_next; in shm16read__read_file()
74 addr = dev->dfsentry->shm16read_addr_next; in shm16read__read_file()
77 return -EDESTADDRREQ; in shm16read__read_file()
93 return -EINVAL; in shm16read__write_file()
95 return -EADDRNOTAVAIL; in shm16read__write_file()
97 return -EADDRNOTAVAIL; in shm16read__write_file()
100 return -EADDRNOTAVAIL; in shm16read__write_file()
103 dev->dfsentry->shm16read_routing_next = routing; in shm16read__write_file()
104 dev->dfsentry->shm16read_addr_next = addr; in shm16read__write_file()
119 return -EINVAL; in shm16write__write_file()
121 return -EADDRNOTAVAIL; in shm16write__write_file()
123 return -EADDRNOTAVAIL; in shm16write__write_file()
126 return -EADDRNOTAVAIL; in shm16write__write_file()
129 return -E2BIG; in shm16write__write_file()
149 routing = dev->dfsentry->shm32read_routing_next; in shm32read__read_file()
150 addr = dev->dfsentry->shm32read_addr_next; in shm32read__read_file()
153 return -EDESTADDRREQ; in shm32read__read_file()
169 return -EINVAL; in shm32read__write_file()
171 return -EADDRNOTAVAIL; in shm32read__write_file()
173 return -EADDRNOTAVAIL; in shm32read__write_file()
176 return -EADDRNOTAVAIL; in shm32read__write_file()
179 dev->dfsentry->shm32read_routing_next = routing; in shm32read__write_file()
180 dev->dfsentry->shm32read_addr_next = addr; in shm32read__write_file()
195 return -EINVAL; in shm32write__write_file()
197 return -EADDRNOTAVAIL; in shm32write__write_file()
199 return -EADDRNOTAVAIL; in shm32write__write_file()
202 return -EADDRNOTAVAIL; in shm32write__write_file()
205 return -E2BIG; in shm32write__write_file()
219 #define B43_MAX_MMIO_ACCESS (0xF00 - 1)
228 addr = dev->dfsentry->mmio16read_next; in mmio16read__read_file()
230 return -EDESTADDRREQ; in mmio16read__read_file()
246 return -EINVAL; in mmio16read__write_file()
248 return -EADDRNOTAVAIL; in mmio16read__write_file()
250 return -EINVAL; in mmio16read__write_file()
252 dev->dfsentry->mmio16read_next = addr; in mmio16read__write_file()
266 return -EINVAL; in mmio16write__write_file()
268 return -EADDRNOTAVAIL; in mmio16write__write_file()
270 return -E2BIG; in mmio16write__write_file()
272 return -EINVAL; in mmio16write__write_file()
292 addr = dev->dfsentry->mmio32read_next; in mmio32read__read_file()
294 return -EDESTADDRREQ; in mmio32read__read_file()
310 return -EINVAL; in mmio32read__write_file()
312 return -EADDRNOTAVAIL; in mmio32read__write_file()
314 return -EINVAL; in mmio32read__write_file()
316 dev->dfsentry->mmio32read_next = addr; in mmio32read__write_file()
330 return -EINVAL; in mmio32write__write_file()
332 return -EADDRNOTAVAIL; in mmio32write__write_file()
334 return -E2BIG; in mmio32write__write_file()
336 return -EINVAL; in mmio32write__write_file()
352 struct b43_txstatus_log *log = &dev->dfsentry->txstatlog; in txstat_read_file()
357 if (log->end < 0) { in txstat_read_file()
361 fappend("b43 TX status reports:\n\n" in txstat_read_file()
364 "intermediate | for_ampdu | acked\n" "---\n"); in txstat_read_file()
365 i = log->end + 1; in txstat_read_file()
370 stat = &(log->log[i]); in txstat_read_file()
371 if (stat->cookie) { in txstat_read_file()
372 fappend("%03d | " in txstat_read_file()
378 stat->cookie, stat->seq, stat->phy_stat, in txstat_read_file()
379 stat->frame_count, stat->rts_count, in txstat_read_file()
380 stat->supp_reason, stat->pm_indicated, in txstat_read_file()
381 stat->intermediate, stat->for_ampdu, in txstat_read_file()
382 stat->acked); in txstat_read_file()
385 if (i == log->end) in txstat_read_file()
402 err = -EINVAL; in restart_write_file()
417 expire -= MAX_JIFFY_OFFSET; in calc_expire_secs()
418 now -= MAX_JIFFY_OFFSET; in calc_expire_secs()
422 return (expire - now) / HZ; in calc_expire_secs()
431 struct b43_lo_calib *cal; in loctls_read_file() local
433 struct b43_phy *phy = &dev->phy; in loctls_read_file()
435 if (phy->type != B43_PHYTYPE_G) { in loctls_read_file()
436 fappend("Device is not a G-PHY\n"); in loctls_read_file()
437 err = -ENODEV; in loctls_read_file()
440 lo = phy->g->lo_control; in loctls_read_file()
441 fappend("-- Local Oscillator calibration data --\n\n"); in loctls_read_file()
442 fappend("HW-power-control enabled: %d\n", in loctls_read_file()
443 dev->phy.hardware_power_control); in loctls_read_file()
444 fappend("TX Bias: 0x%02X, TX Magn: 0x%02X (expire in %lu sec)\n", in loctls_read_file()
445 lo->tx_bias, lo->tx_magn, in loctls_read_file()
446 calc_expire_secs(now, lo->txctl_measured_time, in loctls_read_file()
449 (unsigned int)((lo->power_vector & 0xFFFFFFFF00000000ULL) >> 32), in loctls_read_file()
450 (unsigned int)(lo->power_vector & 0x00000000FFFFFFFFULL), in loctls_read_file()
451 calc_expire_secs(now, lo->pwr_vec_read_time, in loctls_read_file()
455 list_for_each_entry(cal, &lo->calib_list, list) { in loctls_read_file()
458 active = (b43_compare_bbatt(&cal->bbatt, &phy->g->bbatt) && in loctls_read_file()
459 b43_compare_rfatt(&cal->rfatt, &phy->g->rfatt)); in loctls_read_file()
460 fappend("BB(%d), RF(%d,%d) -> I=%d, Q=%d " in loctls_read_file()
462 cal->bbatt.att, in loctls_read_file()
463 cal->rfatt.att, cal->rfatt.with_padmix, in loctls_read_file()
464 cal->ctl.i, cal->ctl.q, in loctls_read_file()
465 calc_expire_secs(now, cal->calib_time, in loctls_read_file()
471 for (i = 0; i < lo->rfatt_list.len; i++) { in loctls_read_file()
472 fappend("%u(%d), ", in loctls_read_file()
473 lo->rfatt_list.list[i].att, in loctls_read_file()
474 lo->rfatt_list.list[i].with_padmix); in loctls_read_file()
478 for (i = 0; i < lo->bbatt_list.len; i++) { in loctls_read_file()
480 lo->bbatt_list.list[i].att); in loctls_read_file()
504 dev = file->private_data; in b43_debugfs_read()
506 return -ENODEV; in b43_debugfs_read()
508 mutex_lock(&dev->wl->mutex); in b43_debugfs_read()
510 err = -ENODEV; in b43_debugfs_read()
516 if (!dfops->read) { in b43_debugfs_read()
517 err = -ENOSYS; in b43_debugfs_read()
522 if (!dfile->buffer) { in b43_debugfs_read()
525 err = -ENOMEM; in b43_debugfs_read()
529 ret = dfops->read(dev, buf, bufsize); in b43_debugfs_read()
535 dfile->data_len = ret; in b43_debugfs_read()
536 dfile->buffer = buf; in b43_debugfs_read()
540 dfile->buffer, in b43_debugfs_read()
541 dfile->data_len); in b43_debugfs_read()
542 if (*ppos >= dfile->data_len) { in b43_debugfs_read()
543 free_pages((unsigned long)dfile->buffer, buforder); in b43_debugfs_read()
544 dfile->buffer = NULL; in b43_debugfs_read()
545 dfile->data_len = 0; in b43_debugfs_read()
548 mutex_unlock(&dev->wl->mutex); in b43_debugfs_read()
565 return -E2BIG; in b43_debugfs_write()
566 dev = file->private_data; in b43_debugfs_write()
568 return -ENODEV; in b43_debugfs_write()
570 mutex_lock(&dev->wl->mutex); in b43_debugfs_write()
572 err = -ENODEV; in b43_debugfs_write()
578 if (!dfops->write) { in b43_debugfs_write()
579 err = -ENOSYS; in b43_debugfs_write()
585 err = -ENOMEM; in b43_debugfs_write()
589 err = -EFAULT; in b43_debugfs_write()
592 err = dfops->write(dev, buf, count); in b43_debugfs_write()
599 mutex_unlock(&dev->wl->mutex); in b43_debugfs_write()
636 enabled = (dev->dfsentry && dev->dfsentry->dyn_debug[feature]); in b43_debug()
648 struct b43_dfsentry *e = dev->dfsentry; in b43_add_dynamic_debug()
651 e->dyn_debug[id] = (initstate); \ in b43_add_dynamic_debug()
652 debugfs_create_bool(name, 0600, e->subdir, \ in b43_add_dynamic_debug()
653 &(e->dyn_debug[id])); \ in b43_add_dynamic_debug()
678 b43err(dev->wl, "debugfs: add device OOM\n"); in b43_debugfs_add_device()
681 e->dev = dev; in b43_debugfs_add_device()
682 log = &e->txstatlog; in b43_debugfs_add_device()
683 log->log = kcalloc(B43_NR_LOGGED_TXSTATUS, in b43_debugfs_add_device()
685 if (!log->log) { in b43_debugfs_add_device()
686 b43err(dev->wl, "debugfs: add device txstatus OOM\n"); in b43_debugfs_add_device()
690 log->end = -1; in b43_debugfs_add_device()
692 dev->dfsentry = e; in b43_debugfs_add_device()
694 snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy)); in b43_debugfs_add_device()
695 e->subdir = debugfs_create_dir(devdir, rootdir); in b43_debugfs_add_device()
697 e->mmio16read_next = 0xFFFF; /* invalid address */ in b43_debugfs_add_device()
698 e->mmio32read_next = 0xFFFF; /* invalid address */ in b43_debugfs_add_device()
699 e->shm16read_routing_next = 0xFFFFFFFF; /* invalid routing */ in b43_debugfs_add_device()
700 e->shm16read_addr_next = 0xFFFFFFFF; /* invalid address */ in b43_debugfs_add_device()
701 e->shm32read_routing_next = 0xFFFFFFFF; /* invalid routing */ in b43_debugfs_add_device()
702 e->shm32read_addr_next = 0xFFFFFFFF; /* invalid address */ in b43_debugfs_add_device()
707 mode, e->subdir, dev, \ in b43_debugfs_add_device()
735 e = dev->dfsentry; in b43_debugfs_remove_device()
739 debugfs_remove(e->subdir); in b43_debugfs_remove_device()
740 kfree(e->txstatlog.log); in b43_debugfs_remove_device()
747 struct b43_dfsentry *e = dev->dfsentry; in b43_debugfs_log_txstat()
754 log = &e->txstatlog; in b43_debugfs_log_txstat()
755 i = log->end + 1; in b43_debugfs_log_txstat()
758 log->end = i; in b43_debugfs_log_txstat()
759 cur = &(log->log[i]); in b43_debugfs_log_txstat()