Lines Matching +full:1 +full:d +full:- +full:histogram

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2011-2020 NXP
34 * It prints the following driver related information -
35 * - Driver name
36 * - Driver version
37 * - Driver extended version
38 * - Interface name
39 * - BSS mode
40 * - Media state (connected or disconnected)
41 * - MAC address
42 * - Total number of Tx bytes
43 * - Total number of Rx bytes
44 * - Total number of Tx packets
45 * - Total number of Rx packets
46 * - Total number of dropped Tx packets
47 * - Total number of dropped Rx packets
48 * - Total number of corrupted Tx packets
49 * - Total number of corrupted Rx packets
50 * - Carrier status (on or off)
51 * - Tx queue status (started or stopped)
53 * For STA mode drivers, it also prints the following extra -
54 * - ESSID
55 * - BSSID
56 * - Channel
57 * - Region code
58 * - Multicast count
59 * - Multicast addresses
66 (struct mwifiex_private *) file->private_data; in mwifiex_info_read()
67 struct net_device *netdev = priv->netdev; in mwifiex_info_read()
77 return -ENOMEM; in mwifiex_info_read()
84 mwifiex_drv_get_driver_version(priv->adapter, fmt, sizeof(fmt) - 1); in mwifiex_info_read()
90 p += sprintf(p, "\nverext = %s", priv->version_str); in mwifiex_info_read()
91 p += sprintf(p, "\ninterface_name=\"%s\"\n", netdev->name); in mwifiex_info_read()
94 p += sprintf(p, "bss_mode=\"%d\"\n", info.bss_mode); in mwifiex_info_read()
99 (!priv->media_connected ? "Disconnected" : "Connected")); in mwifiex_info_read()
100 p += sprintf(p, "mac_address=\"%pM\"\n", netdev->dev_addr); in mwifiex_info_read()
103 p += sprintf(p, "multicast_count=\"%d\"\n", in mwifiex_info_read()
108 p += sprintf(p, "channel=\"%d\"\n", (int) info.bss_chan); in mwifiex_info_read()
111 priv->adapter->region_code); in mwifiex_info_read()
114 p += sprintf(p, "multicast_address[%d]=\"%pM\"\n", in mwifiex_info_read()
115 i++, ha->addr); in mwifiex_info_read()
118 p += sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes); in mwifiex_info_read()
119 p += sprintf(p, "num_rx_bytes = %lu\n", priv->stats.rx_bytes); in mwifiex_info_read()
120 p += sprintf(p, "num_tx_pkts = %lu\n", priv->stats.tx_packets); in mwifiex_info_read()
121 p += sprintf(p, "num_rx_pkts = %lu\n", priv->stats.rx_packets); in mwifiex_info_read()
122 p += sprintf(p, "num_tx_pkts_dropped = %lu\n", priv->stats.tx_dropped); in mwifiex_info_read()
123 p += sprintf(p, "num_rx_pkts_dropped = %lu\n", priv->stats.rx_dropped); in mwifiex_info_read()
124 p += sprintf(p, "num_tx_pkts_err = %lu\n", priv->stats.tx_errors); in mwifiex_info_read()
125 p += sprintf(p, "num_rx_pkts_err = %lu\n", priv->stats.rx_errors); in mwifiex_info_read()
126 p += sprintf(p, "carrier %s\n", ((netif_carrier_ok(priv->netdev)) in mwifiex_info_read()
129 for (i = 0; i < netdev->num_tx_queues; i++) { in mwifiex_info_read()
131 p += sprintf(p, " %d:%s", i, netif_tx_queue_stopped(txq) ? in mwifiex_info_read()
137 (unsigned long) p - page); in mwifiex_info_read()
148 * It prints the following log information -
149 * - Number of multicast Tx frames
150 * - Number of failed packets
151 * - Number of Tx retries
152 * - Number of multicast Tx retries
153 * - Number of duplicate frames
154 * - Number of RTS successes
155 * - Number of RTS failures
156 * - Number of ACK failures
157 * - Number of fragmented Rx frames
158 * - Number of multicast Rx frames
159 * - Number of FCS errors
160 * - Number of Tx frames
161 * - WEP ICV error counts
162 * - Number of received beacons
163 * - Number of missed beacons
170 (struct mwifiex_private *) file->private_data; in mwifiex_getlog_read()
177 return -ENOMEM; in mwifiex_getlog_read()
197 "wepicverrcnt-1 %u\n" in mwifiex_getlog_read()
198 "wepicverrcnt-2 %u\n" in mwifiex_getlog_read()
199 "wepicverrcnt-3 %u\n" in mwifiex_getlog_read()
200 "wepicverrcnt-4 %u\n" in mwifiex_getlog_read()
216 stats.wep_icv_error[1], in mwifiex_getlog_read()
224 (unsigned long) p - page); in mwifiex_getlog_read()
231 /* Sysfs histogram file read handler.
233 * This function is called when the 'histogram' file is opened for reading
234 * It prints the following histogram information -
235 * - Number of histogram samples
236 * - Receive packet number of each rx_rate
237 * - Receive packet number of each snr
238 * - Receive packet number of each nosie_flr
239 * - Receive packet number of each signal streath
246 (struct mwifiex_private *)file->private_data; in mwifiex_histogram_read()
254 return -ENOMEM; in mwifiex_histogram_read()
256 if (!priv || !priv->hist_data) { in mwifiex_histogram_read()
257 ret = -EFAULT; in mwifiex_histogram_read()
261 phist_data = priv->hist_data; in mwifiex_histogram_read()
264 "total samples = %d\n", in mwifiex_histogram_read()
265 atomic_read(&phist_data->num_samples)); in mwifiex_histogram_read()
268 "rx rates (in Mbps): 0=1M 1=2M 2=5.5M 3=11M 4=6M 5=9M 6=12M\n" in mwifiex_histogram_read()
269 "7=18M 8=24M 9=36M 10=48M 11=54M 12-27=MCS0-15(BW20) 28-43=MCS0-15(BW40)\n"); in mwifiex_histogram_read()
271 if (ISSUPP_11ACENABLED(priv->adapter->fw_cap_info)) { in mwifiex_histogram_read()
273 "44-53=MCS0-9(VHT:BW20) 54-63=MCS0-9(VHT:BW40) 64-73=MCS0-9(VHT:BW80)\n\n"); in mwifiex_histogram_read()
279 value = atomic_read(&phist_data->rx_rate[i]); in mwifiex_histogram_read()
281 p += sprintf(p, "rx_rate[%02d] = %d\n", i, value); in mwifiex_histogram_read()
284 if (ISSUPP_11ACENABLED(priv->adapter->fw_cap_info)) { in mwifiex_histogram_read()
287 value = atomic_read(&phist_data->rx_rate[i]); in mwifiex_histogram_read()
289 p += sprintf(p, "rx_rate[%02d] = %d\n", in mwifiex_histogram_read()
295 value = atomic_read(&phist_data->snr[i]); in mwifiex_histogram_read()
297 p += sprintf(p, "snr[%02ddB] = %d\n", i, value); in mwifiex_histogram_read()
300 value = atomic_read(&phist_data->noise_flr[i]); in mwifiex_histogram_read()
302 p += sprintf(p, "noise_flr[%02ddBm] = %d\n", in mwifiex_histogram_read()
303 (int)(i-128), value); in mwifiex_histogram_read()
306 value = atomic_read(&phist_data->sig_str[i]); in mwifiex_histogram_read()
308 p += sprintf(p, "sig_strength[-%02ddBm] = %d\n", in mwifiex_histogram_read()
313 (unsigned long)p - page); in mwifiex_histogram_read()
324 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_histogram_write()
326 if (priv && priv->hist_data) in mwifiex_histogram_write()
337 * It prints the following log information -
338 * - Interrupt count
339 * - WMM AC VO packets count
340 * - WMM AC VI packets count
341 * - WMM AC BE packets count
342 * - WMM AC BK packets count
343 * - Maximum Tx buffer size
344 * - Tx buffer size
345 * - Current Tx buffer size
346 * - Power Save mode
347 * - Power Save state
348 * - Deep Sleep status
349 * - Device wakeup required status
350 * - Number of wakeup tries
351 * - Host Sleep configured status
352 * - Host Sleep activated status
353 * - Number of Tx timeouts
354 * - Number of command timeouts
355 * - Last timed out command ID
356 * - Last timed out command action
357 * - Last command ID
358 * - Last command action
359 * - Last command index
360 * - Last command response ID
361 * - Last command response index
362 * - Last event
363 * - Last event index
364 * - Number of host to card command failures
365 * - Number of sleep confirm command failures
366 * - Number of host to card data failure
367 * - Number of deauthentication events
368 * - Number of disassociation events
369 * - Number of link lost events
370 * - Number of deauthentication commands
371 * - Number of association success commands
372 * - Number of association failure commands
373 * - Number of commands sent
374 * - Number of data packets sent
375 * - Number of command responses received
376 * - Number of events received
377 * - Tx BA stream table (TID, RA)
378 * - Rx reorder table (TID, TA, Start window, Window size, Buffer)
385 (struct mwifiex_private *) file->private_data; in mwifiex_debug_read()
391 return -ENOMEM; in mwifiex_debug_read()
400 (unsigned long) p - page); in mwifiex_debug_read()
424 buf = memdup_user_nul(ubuf, min(count, (size_t)(PAGE_SIZE - 1))); in mwifiex_regrdwr_write()
429 ret = -EINVAL; in mwifiex_regrdwr_write()
434 ret = -EINVAL; in mwifiex_regrdwr_write()
459 (struct mwifiex_private *) file->private_data; in mwifiex_regrdwr_read()
466 return -ENOMEM; in mwifiex_regrdwr_read()
490 ret = -EINVAL; in mwifiex_regrdwr_read()
513 (struct mwifiex_private *)file->private_data; in mwifiex_debug_mask_read()
520 return -ENOMEM; in mwifiex_debug_mask_read()
523 priv->adapter->debug_mask); in mwifiex_debug_mask_read()
540 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_debug_mask_write()
543 buf = memdup_user_nul(ubuf, min(count, (size_t)(PAGE_SIZE - 1))); in mwifiex_debug_mask_write()
548 ret = -EINVAL; in mwifiex_debug_mask_write()
552 priv->adapter->debug_mask = debug_mask; in mwifiex_debug_mask_write()
568 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_verext_write()
573 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) in mwifiex_verext_write()
574 return -EFAULT; in mwifiex_verext_write()
580 priv->versionstrsel = versionstrsel; in mwifiex_verext_write()
594 (struct mwifiex_private *)file->private_data; in mwifiex_verext_read()
598 mwifiex_get_ver_ext(priv, priv->versionstrsel); in mwifiex_verext_read()
600 priv->version_str); in mwifiex_verext_read()
617 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_memrw_write()
620 buf = memdup_user_nul(ubuf, min(count, (size_t)(PAGE_SIZE - 1))); in mwifiex_memrw_write()
626 ret = -EINVAL; in mwifiex_memrw_write()
636 ret = -EINVAL; in mwifiex_memrw_write()
640 memcpy(&priv->mem_rw, &mem_rw, sizeof(mem_rw)); in mwifiex_memrw_write()
643 ret = -1; in mwifiex_memrw_write()
660 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_memrw_read()
666 return -ENOMEM; in mwifiex_memrw_read()
668 pos += snprintf(buf, PAGE_SIZE, "0x%x 0x%x\n", priv->mem_rw.addr, in mwifiex_memrw_read()
669 priv->mem_rw.value); in mwifiex_memrw_read()
676 static u32 saved_offset = -1, saved_bytes = -1;
691 int offset = -1, bytes = -1; in mwifiex_rdeeprom_write()
693 buf = memdup_user_nul(ubuf, min(count, (size_t)(PAGE_SIZE - 1))); in mwifiex_rdeeprom_write()
697 if (sscanf(buf, "%d %d", &offset, &bytes) != 2) { in mwifiex_rdeeprom_write()
698 ret = -EINVAL; in mwifiex_rdeeprom_write()
702 if (offset == -1 || bytes == -1) { in mwifiex_rdeeprom_write()
703 ret = -EINVAL; in mwifiex_rdeeprom_write()
727 (struct mwifiex_private *) file->private_data; in mwifiex_rdeeprom_read()
734 return -ENOMEM; in mwifiex_rdeeprom_read()
736 if (saved_offset == -1) { in mwifiex_rdeeprom_read()
746 ret = -EINVAL; in mwifiex_rdeeprom_read()
750 pos = snprintf(buf, PAGE_SIZE, "%d %d ", saved_offset, saved_bytes); in mwifiex_rdeeprom_read()
753 pos += scnprintf(buf + pos, PAGE_SIZE - pos, "%d ", value[i]); in mwifiex_rdeeprom_read()
769 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_hscfg_write()
776 buf = memdup_user_nul(ubuf, min(count, (size_t)(PAGE_SIZE - 1))); in mwifiex_hscfg_write()
780 arg_num = sscanf(buf, "%d %x %x", &conditions, &gpio, &gap); in mwifiex_hscfg_write()
785 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_hscfg_write()
787 ret = -EINVAL; in mwifiex_hscfg_write()
791 if (arg_num >= 1 && arg_num < 3) in mwifiex_hscfg_write()
812 mwifiex_enable_hs(priv->adapter); in mwifiex_hscfg_write()
813 clear_bit(MWIFIEX_IS_HS_ENABLING, &priv->adapter->work_flags); in mwifiex_hscfg_write()
828 struct mwifiex_private *priv = (void *)file->private_data; in mwifiex_hscfg_read()
835 return -ENOMEM; in mwifiex_hscfg_read()
853 struct mwifiex_private *priv = file->private_data; in mwifiex_timeshare_coex_read()
859 if (priv->adapter->fw_api_ver != MWIFIEX_FW_V15) in mwifiex_timeshare_coex_read()
860 return -EOPNOTSUPP; in mwifiex_timeshare_coex_read()
867 len = sprintf(buf, "%d\n", timeshare_coex); in mwifiex_timeshare_coex_read()
876 struct mwifiex_private *priv = file->private_data; in mwifiex_timeshare_coex_write()
880 if (priv->adapter->fw_api_ver != MWIFIEX_FW_V15) in mwifiex_timeshare_coex_write()
881 return -EOPNOTSUPP; in mwifiex_timeshare_coex_write()
885 if (copy_from_user(&kbuf, ubuf, min_t(size_t, sizeof(kbuf) - 1, count))) in mwifiex_timeshare_coex_write()
886 return -EFAULT; in mwifiex_timeshare_coex_write()
889 return -EINVAL; in mwifiex_timeshare_coex_write()
903 struct mwifiex_private *priv = file->private_data; in mwifiex_reset_write()
904 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_reset_write()
913 return -EINVAL; in mwifiex_reset_write()
915 if (adapter->if_ops.card_reset) { in mwifiex_reset_write()
916 dev_info(adapter->dev, "Resetting per request\n"); in mwifiex_reset_write()
917 adapter->if_ops.card_reset(adapter); in mwifiex_reset_write()
924 debugfs_create_file(#name, 0644, priv->dfs_dev_dir, priv, \
955 MWIFIEX_DFS_FILE_OPS(histogram);
970 priv->dfs_dev_dir = debugfs_create_dir(priv->netdev->name, in mwifiex_dev_debugfs_init()
981 MWIFIEX_DFS_ADD_FILE(histogram); in mwifiex_dev_debugfs_init()
997 debugfs_remove_recursive(priv->dfs_dev_dir); in mwifiex_dev_debugfs_remove()