• Home
  • Raw
  • Download

Lines Matching refs:nic

76    list_for_each_entry(struct nic_info, nic, &gnic_list, list) {  in find_nic_by_name()
77 if (nic->mode != mode) in find_nic_by_name()
80 if (strcasecmp(nic->name, n) == 0) in find_nic_by_name()
81 return nic; in find_nic_by_name()
109 query_wifi_bitrate(const struct nic_info *nic, uint64_t *bitrate) in query_wifi_bitrate() argument
118 snprintf(req.ifr_name, sizeof(req.ifr_name), "%s", nic->name); in query_wifi_bitrate()
125 fprintf(stderr, "Unable to create socket for %s\n", nic->name); in query_wifi_bitrate()
130 fprintf(stderr, "Error performing SIOCGIWSTATS on %s\n", nic->name); in query_wifi_bitrate()
140 query_nic_rssi(const struct nic_info *nic, uint64_t *leveldBm) in query_nic_rssi() argument
149 snprintf(req.ifr_name, sizeof(req.ifr_name), "%s", nic->name); in query_nic_rssi()
154 if (nic->mode != NIC_RSSI_DBM) in query_nic_rssi()
159 fprintf(stderr, "Unable to create socket for %s\n", nic->name); in query_nic_rssi()
165 fprintf(stderr, "Error performing SIOCGIWSTATS on %s\n", nic->name); in query_nic_rssi()
181 struct nic_info *nic = gr->query_data; in query_nic_load() local
184 if (nic->last_time) { in query_nic_load()
185 if (nic->last_time + gr->pane->period <= now) { in query_nic_load()
186 switch (nic->mode) { in query_nic_load()
191 get_nic_bytes(nic->throughput_filename, &bytes); in query_nic_load()
193 ((bytes - nic->last_nic_bytes) / 1000000) * 8; in query_nic_load()
195 float speedMbps = nic->speedMbps; in query_nic_load()
210 nic->last_nic_bytes = bytes; in query_nic_load()
216 query_nic_rssi(nic, &leveldBm); in query_nic_load()
222 nic->last_time = now; in query_nic_load()
227 switch (nic->mode) { in query_nic_load()
230 get_nic_bytes(nic->throughput_filename, &nic->last_nic_bytes); in query_nic_load()
236 nic->last_time = now; in query_nic_load()
251 struct nic_info *nic; in hud_nic_graph_install() local
257 nic = find_nic_by_name(nic_name, mode); in hud_nic_graph_install()
258 if (!nic) in hud_nic_graph_install()
265 nic->mode = mode; in hud_nic_graph_install()
266 if (nic->mode == NIC_DIRECTION_RX) { in hud_nic_graph_install()
267 snprintf(gr->name, sizeof(gr->name), "%s-rx-%"PRId64"Mbps", nic->name, in hud_nic_graph_install()
268 nic->speedMbps); in hud_nic_graph_install()
270 else if (nic->mode == NIC_DIRECTION_TX) { in hud_nic_graph_install()
271 snprintf(gr->name, sizeof(gr->name), "%s-tx-%"PRId64"Mbps", nic->name, in hud_nic_graph_install()
272 nic->speedMbps); in hud_nic_graph_install()
274 else if (nic->mode == NIC_RSSI_DBM) in hud_nic_graph_install()
275 snprintf(gr->name, sizeof(gr->name), "%s-rssi", nic->name); in hud_nic_graph_install()
281 gr->query_data = nic; in hud_nic_graph_install()
303 query_nic_bitrate(struct nic_info *nic, const char *dirbase) in query_nic_bitrate() argument
312 query_wifi_bitrate(nic, &nic->speedMbps); in query_nic_bitrate()
313 nic->speedMbps /= 1000000; in query_nic_bitrate()
318 get_file_value(fn, &nic->speedMbps); in query_nic_bitrate()
333 struct nic_info *nic; in hud_get_num_nics() local
371 nic = CALLOC_STRUCT(nic_info); in hud_get_num_nics()
372 strcpy(nic->name, dp->d_name); in hud_get_num_nics()
373 snprintf(nic->throughput_filename, sizeof(nic->throughput_filename), in hud_get_num_nics()
375 nic->mode = NIC_DIRECTION_RX; in hud_get_num_nics()
376 nic->is_wireless = is_wireless; in hud_get_num_nics()
377 query_nic_bitrate(nic, basename); in hud_get_num_nics()
379 list_addtail(&nic->list, &gnic_list); in hud_get_num_nics()
383 nic = CALLOC_STRUCT(nic_info); in hud_get_num_nics()
384 strcpy(nic->name, dp->d_name); in hud_get_num_nics()
385 snprintf(nic->throughput_filename, in hud_get_num_nics()
386 sizeof(nic->throughput_filename), in hud_get_num_nics()
388 nic->mode = NIC_DIRECTION_TX; in hud_get_num_nics()
389 nic->is_wireless = is_wireless; in hud_get_num_nics()
391 query_nic_bitrate(nic, basename); in hud_get_num_nics()
393 list_addtail(&nic->list, &gnic_list); in hud_get_num_nics()
396 if (nic->is_wireless) { in hud_get_num_nics()
398 nic = CALLOC_STRUCT(nic_info); in hud_get_num_nics()
399 strcpy(nic->name, dp->d_name); in hud_get_num_nics()
400 snprintf(nic->throughput_filename, in hud_get_num_nics()
401 sizeof(nic->throughput_filename), in hud_get_num_nics()
403 nic->mode = NIC_RSSI_DBM; in hud_get_num_nics()
405 query_nic_bitrate(nic, basename); in hud_get_num_nics()
407 list_addtail(&nic->list, &gnic_list); in hud_get_num_nics()
414 list_for_each_entry(struct nic_info, nic, &gnic_list, list) { in hud_get_num_nics()
417 nic->mode == NIC_DIRECTION_RX ? "rx" : in hud_get_num_nics()
418 nic->mode == NIC_DIRECTION_TX ? "tx" : in hud_get_num_nics()
419 nic->mode == NIC_RSSI_DBM ? "rssi" : "undefined", nic->name); in hud_get_num_nics()