1 /*******************************************************************************
3 Intel(R) Gigabit Ethernet Linux driver
4 Copyright(c) 2007-2012 Intel Corporation.
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
23 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 *******************************************************************************/
29 #include "e1000_82575.h"
35 #include <linux/module.h>
36 #include <linux/types.h>
37 #include <linux/proc_fs.h>
38 #include <linux/device.h>
39 #include <linux/netdevice.h>
41 static struct proc_dir_entry *igb_top_dir = NULL;
43 static struct net_device_stats *procfs_get_stats(struct net_device *netdev)
45 #ifndef HAVE_NETDEV_STATS_IN_NETDEV
46 struct igb_adapter *adapter;
51 #ifdef HAVE_NETDEV_STATS_IN_NETDEV
52 /* only return the current stats */
53 return &netdev->stats;
55 adapter = netdev_priv(netdev);
57 /* only return the current stats */
58 return &adapter->net_stats;
59 #endif /* HAVE_NETDEV_STATS_IN_NETDEV */
62 bool igb_thermal_present(struct igb_adapter *adapter)
72 * Only set I2C bit-bang mode if an external thermal sensor is
73 * supported on this device.
76 status = e1000_set_i2c_bb(hw);
77 if (status != E1000_SUCCESS)
81 status = hw->mac.ops.init_thermal_sensor_thresh(hw);
82 if (status != E1000_SUCCESS)
88 static int igb_fwbanner(char *page, char **start, off_t off, int count,
91 struct igb_adapter *adapter = (struct igb_adapter *)data;
93 return snprintf(page, count, "error: no adapter\n");
95 return snprintf(page, count, "%d.%d-%d\n",
96 (adapter->fw_version & 0xF000) >> 12,
97 (adapter->fw_version & 0x0FF0) >> 4,
98 adapter->fw_version & 0x000F);
101 static int igb_numeports(char *page, char **start, off_t off, int count,
102 int *eof, void *data)
106 struct igb_adapter *adapter = (struct igb_adapter *)data;
108 return snprintf(page, count, "error: no adapter\n");
112 return snprintf(page, count, "error: no hw data\n");
116 return snprintf(page, count, "%d\n", ports);
119 static int igb_porttype(char *page, char **start, off_t off, int count,
120 int *eof, void *data)
122 struct igb_adapter *adapter = (struct igb_adapter *)data;
124 return snprintf(page, count, "error: no adapter\n");
126 return snprintf(page, count, "%d\n",
127 test_bit(__IGB_DOWN, &adapter->state));
130 static int igb_portspeed(char *page, char **start, off_t off,
131 int count, int *eof, void *data)
133 struct igb_adapter *adapter = (struct igb_adapter *)data;
136 return snprintf(page, count, "error: no adapter\n");
138 switch (adapter->link_speed) {
139 case E1000_STATUS_SPEED_10:
142 case E1000_STATUS_SPEED_100:
145 case E1000_STATUS_SPEED_1000:
149 return snprintf(page, count, "%d\n", speed);
152 static int igb_wqlflag(char *page, char **start, off_t off, int count,
153 int *eof, void *data)
155 struct igb_adapter *adapter = (struct igb_adapter *)data;
157 return snprintf(page, count, "error: no adapter\n");
159 return snprintf(page, count, "%d\n", adapter->wol);
162 static int igb_xflowctl(char *page, char **start, off_t off, int count,
163 int *eof, void *data)
166 struct igb_adapter *adapter = (struct igb_adapter *)data;
168 return snprintf(page, count, "error: no adapter\n");
172 return snprintf(page, count, "error: no hw data\n");
174 return snprintf(page, count, "%d\n", hw->fc.current_mode);
177 static int igb_rxdrops(char *page, char **start, off_t off, int count,
178 int *eof, void *data)
180 struct igb_adapter *adapter = (struct igb_adapter *)data;
181 struct net_device_stats *net_stats;
184 return snprintf(page, count, "error: no adapter\n");
185 net_stats = procfs_get_stats(adapter->netdev);
186 if (net_stats == NULL)
187 return snprintf(page, count, "error: no net stats\n");
189 return snprintf(page, count, "%lu\n",
190 net_stats->rx_dropped);
193 static int igb_rxerrors(char *page, char **start, off_t off, int count,
194 int *eof, void *data)
196 struct igb_adapter *adapter = (struct igb_adapter *)data;
197 struct net_device_stats *net_stats;
200 return snprintf(page, count, "error: no adapter\n");
201 net_stats = procfs_get_stats(adapter->netdev);
202 if (net_stats == NULL)
203 return snprintf(page, count, "error: no net stats\n");
205 return snprintf(page, count, "%lu\n", net_stats->rx_errors);
208 static int igb_rxupacks(char *page, char **start, off_t off, int count,
209 int *eof, void *data)
212 struct igb_adapter *adapter = (struct igb_adapter *)data;
214 return snprintf(page, count, "error: no adapter\n");
218 return snprintf(page, count, "error: no hw data\n");
220 return snprintf(page, count, "%d\n", E1000_READ_REG(hw, E1000_TPR));
223 static int igb_rxmpacks(char *page, char **start, off_t off, int count,
224 int *eof, void *data)
227 struct igb_adapter *adapter = (struct igb_adapter *)data;
229 return snprintf(page, count, "error: no adapter\n");
233 return snprintf(page, count, "error: no hw data\n");
235 return snprintf(page, count, "%d\n",
236 E1000_READ_REG(hw, E1000_MPRC));
239 static int igb_rxbpacks(char *page, char **start, off_t off, int count,
240 int *eof, void *data)
243 struct igb_adapter *adapter = (struct igb_adapter *)data;
245 return snprintf(page, count, "error: no adapter\n");
249 return snprintf(page, count, "error: no hw data\n");
251 return snprintf(page, count, "%d\n",
252 E1000_READ_REG(hw, E1000_BPRC));
255 static int igb_txupacks(char *page, char **start, off_t off, int count,
256 int *eof, void *data)
259 struct igb_adapter *adapter = (struct igb_adapter *)data;
261 return snprintf(page, count, "error: no adapter\n");
265 return snprintf(page, count, "error: no hw data\n");
267 return snprintf(page, count, "%d\n", E1000_READ_REG(hw, E1000_TPT));
270 static int igb_txmpacks(char *page, char **start, off_t off, int count,
271 int *eof, void *data)
274 struct igb_adapter *adapter = (struct igb_adapter *)data;
276 return snprintf(page, count, "error: no adapter\n");
280 return snprintf(page, count, "error: no hw data\n");
282 return snprintf(page, count, "%d\n",
283 E1000_READ_REG(hw, E1000_MPTC));
286 static int igb_txbpacks(char *page, char **start, off_t off, int count,
287 int *eof, void *data)
290 struct igb_adapter *adapter = (struct igb_adapter *)data;
292 return snprintf(page, count, "error: no adapter\n");
296 return snprintf(page, count, "error: no hw data\n");
298 return snprintf(page, count, "%d\n",
299 E1000_READ_REG(hw, E1000_BPTC));
303 static int igb_txerrors(char *page, char **start, off_t off, int count,
304 int *eof, void *data)
306 struct igb_adapter *adapter = (struct igb_adapter *)data;
307 struct net_device_stats *net_stats;
310 return snprintf(page, count, "error: no adapter\n");
311 net_stats = procfs_get_stats(adapter->netdev);
312 if (net_stats == NULL)
313 return snprintf(page, count, "error: no net stats\n");
315 return snprintf(page, count, "%lu\n",
316 net_stats->tx_errors);
319 static int igb_txdrops(char *page, char **start, off_t off, int count,
320 int *eof, void *data)
322 struct igb_adapter *adapter = (struct igb_adapter *)data;
323 struct net_device_stats *net_stats;
326 return snprintf(page, count, "error: no adapter\n");
327 net_stats = procfs_get_stats(adapter->netdev);
328 if (net_stats == NULL)
329 return snprintf(page, count, "error: no net stats\n");
331 return snprintf(page, count, "%lu\n",
332 net_stats->tx_dropped);
335 static int igb_rxframes(char *page, char **start, off_t off, int count,
336 int *eof, void *data)
338 struct igb_adapter *adapter = (struct igb_adapter *)data;
339 struct net_device_stats *net_stats;
342 return snprintf(page, count, "error: no adapter\n");
343 net_stats = procfs_get_stats(adapter->netdev);
344 if (net_stats == NULL)
345 return snprintf(page, count, "error: no net stats\n");
347 return snprintf(page, count, "%lu\n",
348 net_stats->rx_packets);
351 static int igb_rxbytes(char *page, char **start, off_t off, int count,
352 int *eof, void *data)
354 struct igb_adapter *adapter = (struct igb_adapter *)data;
355 struct net_device_stats *net_stats;
358 return snprintf(page, count, "error: no adapter\n");
359 net_stats = procfs_get_stats(adapter->netdev);
360 if (net_stats == NULL)
361 return snprintf(page, count, "error: no net stats\n");
363 return snprintf(page, count, "%lu\n",
364 net_stats->rx_bytes);
367 static int igb_txframes(char *page, char **start, off_t off, int count,
368 int *eof, void *data)
370 struct igb_adapter *adapter = (struct igb_adapter *)data;
371 struct net_device_stats *net_stats;
374 return snprintf(page, count, "error: no adapter\n");
375 net_stats = procfs_get_stats(adapter->netdev);
376 if (net_stats == NULL)
377 return snprintf(page, count, "error: no net stats\n");
379 return snprintf(page, count, "%lu\n",
380 net_stats->tx_packets);
383 static int igb_txbytes(char *page, char **start, off_t off, int count,
384 int *eof, void *data)
386 struct igb_adapter *adapter = (struct igb_adapter *)data;
387 struct net_device_stats *net_stats;
390 return snprintf(page, count, "error: no adapter\n");
391 net_stats = procfs_get_stats(adapter->netdev);
392 if (net_stats == NULL)
393 return snprintf(page, count, "error: no net stats\n");
395 return snprintf(page, count, "%lu\n",
396 net_stats->tx_bytes);
399 static int igb_linkstat(char *page, char **start, off_t off, int count,
400 int *eof, void *data)
404 struct igb_adapter *adapter = (struct igb_adapter *)data;
406 return snprintf(page, count, "error: no adapter\n");
410 return snprintf(page, count, "error: no hw data\n");
412 if (test_bit(__IGB_DOWN, &adapter->state))
415 if (igb_has_link(adapter))
417 return snprintf(page, count, "0x%X\n", bitmask);
420 static int igb_funcid(char *page, char **start, off_t off,
421 int count, int *eof, void *data)
423 struct igb_adapter *adapter = (struct igb_adapter *)data;
424 struct net_device* netdev;
427 return snprintf(page, count, "error: no adapter\n");
428 netdev = adapter->netdev;
430 return snprintf(page, count, "error: no net device\n");
432 return snprintf(page, count, "0x%lX\n", netdev->base_addr);
435 static int igb_funcvers(char *page, char **start, off_t off,
436 int count, int *eof, void *data)
438 struct igb_adapter *adapter = (struct igb_adapter *)data;
439 struct net_device* netdev;
442 return snprintf(page, count, "error: no adapter\n");
443 netdev = adapter->netdev;
445 return snprintf(page, count, "error: no net device\n");
447 return snprintf(page, count, "%s\n", igb_driver_version);
450 static int igb_macburn(char *page, char **start, off_t off, int count,
451 int *eof, void *data)
454 struct igb_adapter *adapter = (struct igb_adapter *)data;
456 return snprintf(page, count, "error: no adapter\n");
460 return snprintf(page, count, "error: no hw data\n");
462 return snprintf(page, count, "0x%X%X%X%X%X%X\n",
463 (unsigned int)hw->mac.perm_addr[0],
464 (unsigned int)hw->mac.perm_addr[1],
465 (unsigned int)hw->mac.perm_addr[2],
466 (unsigned int)hw->mac.perm_addr[3],
467 (unsigned int)hw->mac.perm_addr[4],
468 (unsigned int)hw->mac.perm_addr[5]);
471 static int igb_macadmn(char *page, char **start, off_t off,
472 int count, int *eof, void *data)
475 struct igb_adapter *adapter = (struct igb_adapter *)data;
477 return snprintf(page, count, "error: no adapter\n");
481 return snprintf(page, count, "error: no hw data\n");
483 return snprintf(page, count, "0x%X%X%X%X%X%X\n",
484 (unsigned int)hw->mac.addr[0],
485 (unsigned int)hw->mac.addr[1],
486 (unsigned int)hw->mac.addr[2],
487 (unsigned int)hw->mac.addr[3],
488 (unsigned int)hw->mac.addr[4],
489 (unsigned int)hw->mac.addr[5]);
492 static int igb_maclla1(char *page, char **start, off_t off, int count,
493 int *eof, void *data)
497 int first_word = 0x37;
501 struct igb_adapter *adapter = (struct igb_adapter *)data;
503 return snprintf(page, count, "error: no adapter\n");
507 return snprintf(page, count, "error: no hw data\n");
509 rc = e1000_read_nvm(hw, first_word, word_count,
511 if (rc != E1000_SUCCESS)
514 switch (hw->bus.func) {
516 return snprintf(page, count, "0x%04X%04X%04X\n",
521 return snprintf(page, count, "0x%04X%04X%04X\n",
526 return snprintf(page, count, "unexpected port %d\n", hw->bus.func);
529 static int igb_mtusize(char *page, char **start, off_t off,
530 int count, int *eof, void *data)
532 struct igb_adapter *adapter = (struct igb_adapter *)data;
533 struct net_device* netdev;
536 return snprintf(page, count, "error: no adapter\n");
537 netdev = adapter->netdev;
539 return snprintf(page, count, "error: no net device\n");
541 return snprintf(page, count, "%d\n", netdev->mtu);
544 static int igb_featflag(char *page, char **start, off_t off, int count,
545 int *eof, void *data)
548 #ifndef HAVE_NDO_SET_FEATURES
549 struct igb_ring *ring;
551 struct igb_adapter *adapter = (struct igb_adapter *)data;
552 struct net_device *netdev;
555 return snprintf(page, count, "error: no adapter\n");
556 netdev = adapter->netdev;
558 return snprintf(page, count, "error: no net device\n");
560 #ifndef HAVE_NDO_SET_FEATURES
561 /* igb_get_rx_csum(netdev) doesn't compile so hard code */
562 ring = adapter->rx_ring[0];
563 bitmask = test_bit(IGB_RING_FLAG_RX_CSUM, &ring->flags);
564 return snprintf(page, count, "%d\n", bitmask);
566 if (netdev->features & NETIF_F_RXCSUM)
568 return snprintf(page, count, "%d\n", bitmask);
572 static int igb_lsominct(char *page, char **start, off_t off, int count,
573 int *eof, void *data)
575 return snprintf(page, count, "%d\n", 1);
578 static int igb_prommode(char *page, char **start, off_t off, int count,
579 int *eof, void *data)
581 struct igb_adapter *adapter = (struct igb_adapter *)data;
582 struct net_device *netdev;
585 return snprintf(page, count, "error: no adapter\n");
586 netdev = adapter->netdev;
588 return snprintf(page, count, "error: no net device\n");
590 return snprintf(page, count, "%d\n",
591 netdev->flags & IFF_PROMISC);
594 static int igb_txdscqsz(char *page, char **start, off_t off, int count,
595 int *eof, void *data)
597 struct igb_adapter *adapter = (struct igb_adapter *)data;
599 return snprintf(page, count, "error: no adapter\n");
601 return snprintf(page, count, "%d\n", adapter->tx_ring[0]->count);
604 static int igb_rxdscqsz(char *page, char **start, off_t off, int count,
605 int *eof, void *data)
607 struct igb_adapter *adapter = (struct igb_adapter *)data;
609 return snprintf(page, count, "error: no adapter\n");
611 return snprintf(page, count, "%d\n", adapter->rx_ring[0]->count);
614 static int igb_rxqavg(char *page, char **start, off_t off, int count,
615 int *eof, void *data)
621 struct igb_adapter *adapter = (struct igb_adapter *)data;
623 return snprintf(page, count, "error: no adapter\n");
625 if (adapter->num_rx_queues <= 0)
626 return snprintf(page, count,
627 "can't calculate, number of queues %d\n",
628 adapter->num_rx_queues);
630 for (index = 0; index < adapter->num_rx_queues; index++) {
631 ntc = adapter->rx_ring[index]->next_to_clean;
632 ntu = adapter->rx_ring[index]->next_to_use;
635 totaldiff += (ntc - ntu);
637 totaldiff += (adapter->rx_ring[index]->count
640 if (adapter->num_rx_queues <= 0)
641 return snprintf(page, count,
642 "can't calculate, number of queues %d\n",
643 adapter->num_rx_queues);
644 return snprintf(page, count, "%d\n", totaldiff/adapter->num_rx_queues);
647 static int igb_txqavg(char *page, char **start, off_t off, int count,
648 int *eof, void *data)
654 struct igb_adapter *adapter = (struct igb_adapter *)data;
656 return snprintf(page, count, "error: no adapter\n");
658 if (adapter->num_tx_queues <= 0)
659 return snprintf(page, count,
660 "can't calculate, number of queues %d\n",
661 adapter->num_tx_queues);
663 for (index = 0; index < adapter->num_tx_queues; index++) {
664 ntc = adapter->tx_ring[index]->next_to_clean;
665 ntu = adapter->tx_ring[index]->next_to_use;
668 totaldiff += (ntc - ntu);
670 totaldiff += (adapter->tx_ring[index]->count
673 if (adapter->num_tx_queues <= 0)
674 return snprintf(page, count,
675 "can't calculate, number of queues %d\n",
676 adapter->num_tx_queues);
677 return snprintf(page, count, "%d\n",
678 totaldiff/adapter->num_tx_queues);
681 static int igb_iovotype(char *page, char **start, off_t off, int count,
682 int *eof, void *data)
684 return snprintf(page, count, "2\n");
687 static int igb_funcnbr(char *page, char **start, off_t off, int count,
688 int *eof, void *data)
690 struct igb_adapter *adapter = (struct igb_adapter *)data;
692 return snprintf(page, count, "error: no adapter\n");
694 return snprintf(page, count, "%d\n", adapter->vfs_allocated_count);
697 static int igb_therm_location(char *page, char **start, off_t off,
698 int count, int *eof, void *data)
700 struct igb_therm_proc_data *therm_data =
701 (struct igb_therm_proc_data *)data;
703 if (therm_data == NULL)
704 return snprintf(page, count, "error: no therm_data\n");
706 return snprintf(page, count, "%d\n", therm_data->sensor_data->location);
709 static int igb_therm_maxopthresh(char *page, char **start, off_t off,
710 int count, int *eof, void *data)
712 struct igb_therm_proc_data *therm_data =
713 (struct igb_therm_proc_data *)data;
715 if (therm_data == NULL)
716 return snprintf(page, count, "error: no therm_data\n");
718 return snprintf(page, count, "%d\n",
719 therm_data->sensor_data->max_op_thresh);
722 static int igb_therm_cautionthresh(char *page, char **start, off_t off,
723 int count, int *eof, void *data)
725 struct igb_therm_proc_data *therm_data =
726 (struct igb_therm_proc_data *)data;
728 if (therm_data == NULL)
729 return snprintf(page, count, "error: no therm_data\n");
731 return snprintf(page, count, "%d\n",
732 therm_data->sensor_data->caution_thresh);
735 static int igb_therm_temp(char *page, char **start, off_t off,
736 int count, int *eof, void *data)
739 struct igb_therm_proc_data *therm_data =
740 (struct igb_therm_proc_data *)data;
742 if (therm_data == NULL)
743 return snprintf(page, count, "error: no therm_data\n");
745 status = e1000_get_thermal_sensor_data(therm_data->hw);
746 if (status != E1000_SUCCESS)
747 snprintf(page, count, "error: status %d returned\n", status);
749 return snprintf(page, count, "%d\n", therm_data->sensor_data->temp);
752 struct igb_proc_type{
754 int (*read)(char*, char**, off_t, int, int*, void*);
757 struct igb_proc_type igb_proc_entries[] = {
758 {"fwbanner", &igb_fwbanner},
759 {"numeports", &igb_numeports},
760 {"porttype", &igb_porttype},
761 {"portspeed", &igb_portspeed},
762 {"wqlflag", &igb_wqlflag},
763 {"xflowctl", &igb_xflowctl},
764 {"rxdrops", &igb_rxdrops},
765 {"rxerrors", &igb_rxerrors},
766 {"rxupacks", &igb_rxupacks},
767 {"rxmpacks", &igb_rxmpacks},
768 {"rxbpacks", &igb_rxbpacks},
769 {"txdrops", &igb_txdrops},
770 {"txerrors", &igb_txerrors},
771 {"txupacks", &igb_txupacks},
772 {"txmpacks", &igb_txmpacks},
773 {"txbpacks", &igb_txbpacks},
774 {"rxframes", &igb_rxframes},
775 {"rxbytes", &igb_rxbytes},
776 {"txframes", &igb_txframes},
777 {"txbytes", &igb_txbytes},
778 {"linkstat", &igb_linkstat},
779 {"funcid", &igb_funcid},
780 {"funcvers", &igb_funcvers},
781 {"macburn", &igb_macburn},
782 {"macadmn", &igb_macadmn},
783 {"maclla1", &igb_maclla1},
784 {"mtusize", &igb_mtusize},
785 {"featflag", &igb_featflag},
786 {"lsominct", &igb_lsominct},
787 {"prommode", &igb_prommode},
788 {"txdscqsz", &igb_txdscqsz},
789 {"rxdscqsz", &igb_rxdscqsz},
790 {"txqavg", &igb_txqavg},
791 {"rxqavg", &igb_rxqavg},
792 {"iovotype", &igb_iovotype},
793 {"funcnbr", &igb_funcnbr},
797 struct igb_proc_type igb_internal_entries[] = {
798 {"location", &igb_therm_location},
799 {"temp", &igb_therm_temp},
800 {"cautionthresh", &igb_therm_cautionthresh},
801 {"maxopthresh", &igb_therm_maxopthresh},
805 void igb_del_proc_entries(struct igb_adapter *adapter)
808 char buf[16]; /* much larger than the sensor number will ever be */
810 if (igb_top_dir == NULL)
813 for (i = 0; i < E1000_MAX_SENSORS; i++) {
814 if (adapter->therm_dir[i] == NULL)
817 for (index = 0; ; index++) {
818 if (igb_internal_entries[index].read == NULL)
821 remove_proc_entry(igb_internal_entries[index].name,
822 adapter->therm_dir[i]);
824 snprintf(buf, sizeof(buf), "sensor_%d", i);
825 remove_proc_entry(buf, adapter->info_dir);
828 if (adapter->info_dir != NULL) {
829 for (index = 0; ; index++) {
830 if (igb_proc_entries[index].read == NULL)
832 remove_proc_entry(igb_proc_entries[index].name,
835 remove_proc_entry("info", adapter->eth_dir);
838 if (adapter->eth_dir != NULL)
839 remove_proc_entry(pci_name(adapter->pdev), igb_top_dir);
842 /* called from igb_main.c */
843 void igb_procfs_exit(struct igb_adapter *adapter)
845 igb_del_proc_entries(adapter);
848 int igb_procfs_topdir_init(void)
850 igb_top_dir = proc_mkdir("driver/igb", NULL);
851 if (igb_top_dir == NULL)
857 void igb_procfs_topdir_exit(void)
859 // remove_proc_entry("driver", proc_root_driver);
860 remove_proc_entry("driver/igb", NULL);
863 /* called from igb_main.c */
864 int igb_procfs_init(struct igb_adapter *adapter)
869 char buf[16]; /* much larger than the sensor number will ever be */
871 adapter->eth_dir = NULL;
872 adapter->info_dir = NULL;
873 for (i = 0; i < E1000_MAX_SENSORS; i++)
874 adapter->therm_dir[i] = NULL;
876 if ( igb_top_dir == NULL ) {
881 adapter->eth_dir = proc_mkdir(pci_name(adapter->pdev), igb_top_dir);
882 if (adapter->eth_dir == NULL) {
887 adapter->info_dir = proc_mkdir("info", adapter->eth_dir);
888 if (adapter->info_dir == NULL) {
892 for (index = 0; ; index++) {
893 if (igb_proc_entries[index].read == NULL) {
896 if (!(create_proc_read_entry(igb_proc_entries[index].name,
899 igb_proc_entries[index].read,
906 if (igb_thermal_present(adapter) == false)
909 for (i = 0; i < E1000_MAX_SENSORS; i++) {
911 if (adapter->hw.mac.thermal_sensor_data.sensor[i].location== 0)
914 snprintf(buf, sizeof(buf), "sensor_%d", i);
915 adapter->therm_dir[i] = proc_mkdir(buf, adapter->info_dir);
916 if (adapter->therm_dir[i] == NULL) {
920 for (index = 0; ; index++) {
921 if (igb_internal_entries[index].read == NULL)
924 * therm_data struct contains pointer the read func
927 adapter->therm_data[i].hw = &adapter->hw;
928 adapter->therm_data[i].sensor_data =
929 &adapter->hw.mac.thermal_sensor_data.sensor[i];
931 if (!(create_proc_read_entry(
932 igb_internal_entries[index].name,
934 adapter->therm_dir[i],
935 igb_internal_entries[index].read,
936 &adapter->therm_data[i]))) {
945 igb_del_proc_entries(adapter);
950 #endif /* !IGB_SYSFS */
951 #endif /* IGB_PROCFS */