debugfs.c (dedec35b40195f56d16386eea51c8255bf034dba) | debugfs.c (9b586118730e1b86dc3c8d8523effc712c5a2bfc) |
---|---|
1/* 2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc. 3 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 1322 unchanged lines hidden (view full) --- 1331} 1332DEFINE_SHOW_ATTRIBUTE(bf); 1333 1334/*---------temp------------*/ 1335static void print_temp(struct seq_file *s, const char *prefix, s32 t) 1336{ 1337 switch (t) { 1338 case 0: | 1/* 2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc. 3 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 1322 unchanged lines hidden (view full) --- 1331} 1332DEFINE_SHOW_ATTRIBUTE(bf); 1333 1334/*---------temp------------*/ 1335static void print_temp(struct seq_file *s, const char *prefix, s32 t) 1336{ 1337 switch (t) { 1338 case 0: |
1339 case ~(u32)0: | 1339 case WMI_INVALID_TEMPERATURE: |
1340 seq_printf(s, "%s N/A\n", prefix); 1341 break; 1342 default: 1343 seq_printf(s, "%s %s%d.%03d\n", prefix, (t < 0 ? "-" : ""), 1344 abs(t / 1000), abs(t % 1000)); 1345 break; 1346 } 1347} 1348 1349static int temp_show(struct seq_file *s, void *data) 1350{ 1351 struct wil6210_priv *wil = s->private; | 1340 seq_printf(s, "%s N/A\n", prefix); 1341 break; 1342 default: 1343 seq_printf(s, "%s %s%d.%03d\n", prefix, (t < 0 ? "-" : ""), 1344 abs(t / 1000), abs(t % 1000)); 1345 break; 1346 } 1347} 1348 1349static int temp_show(struct seq_file *s, void *data) 1350{ 1351 struct wil6210_priv *wil = s->private; |
1352 s32 t_m, t_r; 1353 int rc = wmi_get_temperature(wil, &t_m, &t_r); | 1352 int rc, i; |
1354 | 1353 |
1355 if (rc) { 1356 seq_puts(s, "Failed\n"); 1357 return 0; 1358 } | 1354 if (test_bit(WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF, 1355 wil->fw_capabilities)) { 1356 struct wmi_temp_sense_all_done_event sense_all_evt; |
1359 | 1357 |
1360 print_temp(s, "T_mac =", t_m); 1361 print_temp(s, "T_radio =", t_r); | 1358 wil_dbg_misc(wil, 1359 "WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF is supported"); 1360 rc = wmi_get_all_temperatures(wil, &sense_all_evt); 1361 if (rc) { 1362 seq_puts(s, "Failed\n"); 1363 return 0; 1364 } 1365 print_temp(s, "T_mac =", 1366 le32_to_cpu(sense_all_evt.baseband_t1000)); 1367 seq_printf(s, "Connected RFs [0x%08x]\n", 1368 sense_all_evt.rf_bitmap); 1369 for (i = 0; i < WMI_MAX_XIF_PORTS_NUM; i++) { 1370 seq_printf(s, "RF[%d] = ", i); 1371 print_temp(s, "", 1372 le32_to_cpu(sense_all_evt.rf_t1000[i])); 1373 } 1374 } else { 1375 s32 t_m, t_r; |
1362 | 1376 |
1377 wil_dbg_misc(wil, 1378 "WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF is not supported"); 1379 rc = wmi_get_temperature(wil, &t_m, &t_r); 1380 if (rc) { 1381 seq_puts(s, "Failed\n"); 1382 return 0; 1383 } 1384 print_temp(s, "T_mac =", t_m); 1385 print_temp(s, "T_radio =", t_r); 1386 } |
|
1363 return 0; 1364} 1365DEFINE_SHOW_ATTRIBUTE(temp); 1366 1367/*---------freq------------*/ 1368static int freq_show(struct seq_file *s, void *data) 1369{ 1370 struct wil6210_priv *wil = s->private; --- 1130 unchanged lines hidden --- | 1387 return 0; 1388} 1389DEFINE_SHOW_ATTRIBUTE(temp); 1390 1391/*---------freq------------*/ 1392static int freq_show(struct seq_file *s, void *data) 1393{ 1394 struct wil6210_priv *wil = s->private; --- 1130 unchanged lines hidden --- |