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 <[email protected]>
43 p = dev->dfsentry; in fops_to_dfs_file()
44 p += dfops->file_struct_offset; in fops_to_dfs_file()
52 if (bufsize - count) \
54 bufsize - count, \
72 routing = dev->dfsentry->shm16read_routing_next; in shm16read__read_file()
73 addr = dev->dfsentry->shm16read_addr_next; in shm16read__read_file()
76 return -EDESTADDRREQ; in shm16read__read_file()
92 return -EINVAL; in shm16read__write_file()
94 return -EADDRNOTAVAIL; in shm16read__write_file()
96 return -EADDRNOTAVAIL; in shm16read__write_file()
99 return -EADDRNOTAVAIL; in shm16read__write_file()
102 dev->dfsentry->shm16read_routing_next = routing; in shm16read__write_file()
103 dev->dfsentry->shm16read_addr_next = addr; in shm16read__write_file()
118 return -EINVAL; in shm16write__write_file()
120 return -EADDRNOTAVAIL; in shm16write__write_file()
122 return -EADDRNOTAVAIL; in shm16write__write_file()
125 return -EADDRNOTAVAIL; in shm16write__write_file()
128 return -E2BIG; in shm16write__write_file()
148 routing = dev->dfsentry->shm32read_routing_next; in shm32read__read_file()
149 addr = dev->dfsentry->shm32read_addr_next; in shm32read__read_file()
152 return -EDESTADDRREQ; in shm32read__read_file()
168 return -EINVAL; in shm32read__write_file()
170 return -EADDRNOTAVAIL; in shm32read__write_file()
172 return -EADDRNOTAVAIL; in shm32read__write_file()
175 return -EADDRNOTAVAIL; in shm32read__write_file()
178 dev->dfsentry->shm32read_routing_next = routing; in shm32read__write_file()
179 dev->dfsentry->shm32read_addr_next = addr; in shm32read__write_file()
194 return -EINVAL; in shm32write__write_file()
196 return -EADDRNOTAVAIL; in shm32write__write_file()
198 return -EADDRNOTAVAIL; in shm32write__write_file()
201 return -EADDRNOTAVAIL; in shm32write__write_file()
204 return -E2BIG; in shm32write__write_file()
218 #define B43_MAX_MMIO_ACCESS (0xF00 - 1)
227 addr = dev->dfsentry->mmio16read_next; in mmio16read__read_file()
229 return -EDESTADDRREQ; in mmio16read__read_file()
245 return -EINVAL; in mmio16read__write_file()
247 return -EADDRNOTAVAIL; in mmio16read__write_file()
249 return -EINVAL; in mmio16read__write_file()
251 dev->dfsentry->mmio16read_next = addr; in mmio16read__write_file()
265 return -EINVAL; in mmio16write__write_file()
267 return -EADDRNOTAVAIL; in mmio16write__write_file()
269 return -E2BIG; in mmio16write__write_file()
271 return -EINVAL; in mmio16write__write_file()
291 addr = dev->dfsentry->mmio32read_next; in mmio32read__read_file()
293 return -EDESTADDRREQ; in mmio32read__read_file()
309 return -EINVAL; in mmio32read__write_file()
311 return -EADDRNOTAVAIL; in mmio32read__write_file()
313 return -EINVAL; in mmio32read__write_file()
315 dev->dfsentry->mmio32read_next = addr; in mmio32read__write_file()
329 return -EINVAL; in mmio32write__write_file()
331 return -EADDRNOTAVAIL; in mmio32write__write_file()
333 return -E2BIG; in mmio32write__write_file()
335 return -EINVAL; in mmio32write__write_file()
351 struct b43_txstatus_log *log = &dev->dfsentry->txstatlog; in txstat_read_file()
356 if (log->end < 0) { in txstat_read_file()
360 fappend("b43 TX status reports:\n\n" in txstat_read_file()
363 "intermediate | for_ampdu | acked\n" "---\n"); in txstat_read_file()
364 i = log->end + 1; in txstat_read_file()
369 stat = &(log->log[i]); in txstat_read_file()
370 if (stat->cookie) { in txstat_read_file()
371 fappend("%03d | " in txstat_read_file()
377 stat->cookie, stat->seq, stat->phy_stat, in txstat_read_file()
378 stat->frame_count, stat->rts_count, in txstat_read_file()
379 stat->supp_reason, stat->pm_indicated, in txstat_read_file()
380 stat->intermediate, stat->for_ampdu, in txstat_read_file()
381 stat->acked); in txstat_read_file()
384 if (i == log->end) in txstat_read_file()
401 err = -EINVAL; in restart_write_file()
416 expire -= MAX_JIFFY_OFFSET; in calc_expire_secs()
417 now -= MAX_JIFFY_OFFSET; in calc_expire_secs()
421 return (expire - now) / HZ; in calc_expire_secs()
430 struct b43_lo_calib *cal; in loctls_read_file() local
432 struct b43_phy *phy = &dev->phy; in loctls_read_file()
434 if (phy->type != B43_PHYTYPE_G) { in loctls_read_file()
435 fappend("Device is not a G-PHY\n"); in loctls_read_file()
436 err = -ENODEV; in loctls_read_file()
439 lo = phy->g->lo_control; in loctls_read_file()
440 fappend("-- Local Oscillator calibration data --\n\n"); in loctls_read_file()
441 fappend("HW-power-control enabled: %d\n", in loctls_read_file()
442 dev->phy.hardware_power_control); in loctls_read_file()
443 fappend("TX Bias: 0x%02X, TX Magn: 0x%02X (expire in %lu sec)\n", in loctls_read_file()
444 lo->tx_bias, lo->tx_magn, in loctls_read_file()
445 calc_expire_secs(now, lo->txctl_measured_time, in loctls_read_file()
448 (unsigned int)((lo->power_vector & 0xFFFFFFFF00000000ULL) >> 32), in loctls_read_file()
449 (unsigned int)(lo->power_vector & 0x00000000FFFFFFFFULL), in loctls_read_file()
450 calc_expire_secs(now, lo->pwr_vec_read_time, in loctls_read_file()
454 list_for_each_entry(cal, &lo->calib_list, list) { in loctls_read_file()
457 active = (b43_compare_bbatt(&cal->bbatt, &phy->g->bbatt) && in loctls_read_file()
458 b43_compare_rfatt(&cal->rfatt, &phy->g->rfatt)); in loctls_read_file()
459 fappend("BB(%d), RF(%d,%d) -> I=%d, Q=%d " in loctls_read_file()
461 cal->bbatt.att, in loctls_read_file()
462 cal->rfatt.att, cal->rfatt.with_padmix, in loctls_read_file()
463 cal->ctl.i, cal->ctl.q, in loctls_read_file()
464 calc_expire_secs(now, cal->calib_time, in loctls_read_file()
470 for (i = 0; i < lo->rfatt_list.len; i++) { in loctls_read_file()
471 fappend("%u(%d), ", in loctls_read_file()
472 lo->rfatt_list.list[i].att, in loctls_read_file()
473 lo->rfatt_list.list[i].with_padmix); in loctls_read_file()
477 for (i = 0; i < lo->bbatt_list.len; i++) { in loctls_read_file()
479 lo->bbatt_list.list[i].att); in loctls_read_file()
503 dev = file->private_data; in b43_debugfs_read()
505 return -ENODEV; in b43_debugfs_read()
507 mutex_lock(&dev->wl->mutex); in b43_debugfs_read()
509 err = -ENODEV; in b43_debugfs_read()
514 if (!dfops->read) { in b43_debugfs_read()
515 err = -ENOSYS; in b43_debugfs_read()
520 if (!dfile->buffer) { in b43_debugfs_read()
523 err = -ENOMEM; in b43_debugfs_read()
527 ret = dfops->read(dev, buf, bufsize); in b43_debugfs_read()
533 dfile->data_len = ret; in b43_debugfs_read()
534 dfile->buffer = buf; in b43_debugfs_read()
538 dfile->buffer, in b43_debugfs_read()
539 dfile->data_len); in b43_debugfs_read()
540 if (*ppos >= dfile->data_len) { in b43_debugfs_read()
541 free_pages((unsigned long)dfile->buffer, buforder); in b43_debugfs_read()
542 dfile->buffer = NULL; in b43_debugfs_read()
543 dfile->data_len = 0; in b43_debugfs_read()
546 mutex_unlock(&dev->wl->mutex); in b43_debugfs_read()
563 return -E2BIG; in b43_debugfs_write()
564 dev = file->private_data; in b43_debugfs_write()
566 return -ENODEV; in b43_debugfs_write()
568 mutex_lock(&dev->wl->mutex); in b43_debugfs_write()
570 err = -ENODEV; in b43_debugfs_write()
575 if (!dfops->write) { in b43_debugfs_write()
576 err = -ENOSYS; in b43_debugfs_write()
582 err = -ENOMEM; in b43_debugfs_write()
586 err = -EFAULT; in b43_debugfs_write()
589 err = dfops->write(dev, buf, count); in b43_debugfs_write()
596 mutex_unlock(&dev->wl->mutex); in b43_debugfs_write()
633 enabled = (dev->dfsentry && dev->dfsentry->dyn_debug[feature]); in b43_debug()
645 struct b43_dfsentry *e = dev->dfsentry; in b43_add_dynamic_debug()
648 e->dyn_debug[id] = (initstate); \ in b43_add_dynamic_debug()
649 debugfs_create_bool(name, 0600, e->subdir, \ in b43_add_dynamic_debug()
650 &(e->dyn_debug[id])); \ in b43_add_dynamic_debug()
675 b43err(dev->wl, "debugfs: add device OOM\n"); in b43_debugfs_add_device()
678 e->dev = dev; in b43_debugfs_add_device()
679 log = &e->txstatlog; in b43_debugfs_add_device()
680 log->log = kcalloc(B43_NR_LOGGED_TXSTATUS, in b43_debugfs_add_device()
682 if (!log->log) { in b43_debugfs_add_device()
683 b43err(dev->wl, "debugfs: add device txstatus OOM\n"); in b43_debugfs_add_device()
687 log->end = -1; in b43_debugfs_add_device()
689 dev->dfsentry = e; in b43_debugfs_add_device()
691 snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy)); in b43_debugfs_add_device()
692 e->subdir = debugfs_create_dir(devdir, rootdir); in b43_debugfs_add_device()
694 e->mmio16read_next = 0xFFFF; /* invalid address */ in b43_debugfs_add_device()
695 e->mmio32read_next = 0xFFFF; /* invalid address */ in b43_debugfs_add_device()
696 e->shm16read_routing_next = 0xFFFFFFFF; /* invalid routing */ in b43_debugfs_add_device()
697 e->shm16read_addr_next = 0xFFFFFFFF; /* invalid address */ in b43_debugfs_add_device()
698 e->shm32read_routing_next = 0xFFFFFFFF; /* invalid routing */ in b43_debugfs_add_device()
699 e->shm32read_addr_next = 0xFFFFFFFF; /* invalid address */ in b43_debugfs_add_device()
704 mode, e->subdir, dev, \ in b43_debugfs_add_device()
732 e = dev->dfsentry; in b43_debugfs_remove_device()
736 debugfs_remove(e->subdir); in b43_debugfs_remove_device()
737 kfree(e->txstatlog.log); in b43_debugfs_remove_device()
744 struct b43_dfsentry *e = dev->dfsentry; in b43_debugfs_log_txstat()
751 log = &e->txstatlog; in b43_debugfs_log_txstat()
752 i = log->end + 1; in b43_debugfs_log_txstat()
755 log->end = i; in b43_debugfs_log_txstat()
756 cur = &(log->log[i]); in b43_debugfs_log_txstat()