diff options
Diffstat (limited to 'drivers/net/igb/igb_procfs.c')
-rw-r--r-- | drivers/net/igb/igb_procfs.c | 69 |
1 files changed, 31 insertions, 38 deletions
diff --git a/drivers/net/igb/igb_procfs.c b/drivers/net/igb/igb_procfs.c index 2e7850ca1d6e..922c3b86d8c7 100644 --- a/drivers/net/igb/igb_procfs.c +++ b/drivers/net/igb/igb_procfs.c @@ -1,7 +1,7 @@ /******************************************************************************* Intel(R) Gigabit Ethernet Linux driver - Copyright(c) 2007-2013 Intel Corporation. + Copyright(c) 2007-2014 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, @@ -12,14 +12,11 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - The full GNU General Public License is included in this distribution in the file called "COPYING". Contact Information: + Linux NICS <linux.nics@intel.com> e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 @@ -38,8 +35,7 @@ #include <linux/device.h> #include <linux/netdevice.h> -static struct proc_dir_entry *igb_top_dir = NULL; - +static struct proc_dir_entry *igb_top_dir; bool igb_thermal_present(struct igb_adapter *adapter) { @@ -63,12 +59,11 @@ bool igb_thermal_present(struct igb_adapter *adapter) status = hw->mac.ops.init_thermal_sensor_thresh(hw); if (status != E1000_SUCCESS) return false; - + return true; } - -static int igb_macburn(char *page, char **start, off_t off, int count, +static int igb_macburn(char *page, char **start, off_t off, int count, int *eof, void *data) { struct e1000_hw *hw; @@ -89,7 +84,7 @@ static int igb_macburn(char *page, char **start, off_t off, int count, (unsigned int)hw->mac.perm_addr[5]); } -static int igb_macadmn(char *page, char **start, off_t off, +static int igb_macadmn(char *page, char **start, off_t off, int count, int *eof, void *data) { struct e1000_hw *hw; @@ -139,7 +134,7 @@ static int igb_porttype(char *page, char **start, off_t off, int count, test_bit(__IGB_DOWN, &adapter->state)); } -static int igb_therm_location(char *page, char **start, off_t off, +static int igb_therm_location(char *page, char **start, off_t off, int count, int *eof, void *data) { struct igb_therm_proc_data *therm_data = @@ -151,7 +146,7 @@ static int igb_therm_location(char *page, char **start, off_t off, return snprintf(page, count, "%d\n", therm_data->sensor_data->location); } -static int igb_therm_maxopthresh(char *page, char **start, off_t off, +static int igb_therm_maxopthresh(char *page, char **start, off_t off, int count, int *eof, void *data) { struct igb_therm_proc_data *therm_data = @@ -164,7 +159,7 @@ static int igb_therm_maxopthresh(char *page, char **start, off_t off, therm_data->sensor_data->max_op_thresh); } -static int igb_therm_cautionthresh(char *page, char **start, off_t off, +static int igb_therm_cautionthresh(char *page, char **start, off_t off, int count, int *eof, void *data) { struct igb_therm_proc_data *therm_data = @@ -177,7 +172,7 @@ static int igb_therm_cautionthresh(char *page, char **start, off_t off, therm_data->sensor_data->caution_thresh); } -static int igb_therm_temp(char *page, char **start, off_t off, +static int igb_therm_temp(char *page, char **start, off_t off, int count, int *eof, void *data) { s32 status; @@ -188,13 +183,13 @@ static int igb_therm_temp(char *page, char **start, off_t off, return snprintf(page, count, "error: no therm_data\n"); status = e1000_get_thermal_sensor_data(therm_data->hw); - if (status != E1000_SUCCESS) + if (status != E1000_SUCCESS) snprintf(page, count, "error: status %d returned\n", status); return snprintf(page, count, "%d\n", therm_data->sensor_data->temp); } -struct igb_proc_type{ +struct igb_proc_type { char name[32]; int (*read)(char*, char**, off_t, int, int*, void*); }; @@ -211,7 +206,7 @@ struct igb_proc_type igb_internal_entries[] = { {"location", &igb_therm_location}, {"temp", &igb_therm_temp}, {"cautionthresh", &igb_therm_cautionthresh}, - {"maxopthresh", &igb_therm_maxopthresh}, + {"maxopthresh", &igb_therm_maxopthresh}, {"", NULL} }; @@ -242,8 +237,8 @@ void igb_del_proc_entries(struct igb_adapter *adapter) for (index = 0; ; index++) { if (igb_proc_entries[index].read == NULL) break; - remove_proc_entry(igb_proc_entries[index].name, - adapter->info_dir); + remove_proc_entry(igb_proc_entries[index].name, + adapter->info_dir); } remove_proc_entry("info", adapter->eth_dir); } @@ -253,12 +248,12 @@ void igb_del_proc_entries(struct igb_adapter *adapter) } /* called from igb_main.c */ -void igb_procfs_exit(struct igb_adapter *adapter) +void igb_procfs_exit(struct igb_adapter *adapter) { igb_del_proc_entries(adapter); } -int igb_procfs_topdir_init(void) +int igb_procfs_topdir_init(void) { igb_top_dir = proc_mkdir("driver/igb", NULL); if (igb_top_dir == NULL) @@ -267,13 +262,13 @@ int igb_procfs_topdir_init(void) return 0; } -void igb_procfs_topdir_exit(void) +void igb_procfs_topdir_exit(void) { remove_proc_entry("driver/igb", NULL); } /* called from igb_main.c */ -int igb_procfs_init(struct igb_adapter *adapter) +int igb_procfs_init(struct igb_adapter *adapter) { int rc = 0; int i; @@ -285,7 +280,7 @@ int igb_procfs_init(struct igb_adapter *adapter) for (i = 0; i < E1000_MAX_SENSORS; i++) adapter->therm_dir[i] = NULL; - if ( igb_top_dir == NULL ) { + if (igb_top_dir == NULL) { rc = -ENOMEM; goto fail; } @@ -302,13 +297,12 @@ int igb_procfs_init(struct igb_adapter *adapter) goto fail; } for (index = 0; ; index++) { - if (igb_proc_entries[index].read == NULL) { + if (igb_proc_entries[index].read == NULL) break; - } - if (!(create_proc_read_entry(igb_proc_entries[index].name, - 0444, - adapter->info_dir, - igb_proc_entries[index].read, + if (!(create_proc_read_entry(igb_proc_entries[index].name, + 0444, + adapter->info_dir, + igb_proc_entries[index].read, adapter))) { rc = -ENOMEM; @@ -319,8 +313,7 @@ int igb_procfs_init(struct igb_adapter *adapter) goto exit; for (i = 0; i < E1000_MAX_SENSORS; i++) { - - if (adapter->hw.mac.thermal_sensor_data.sensor[i].location== 0) + if (adapter->hw.mac.thermal_sensor_data.sensor[i].location == 0) continue; snprintf(buf, sizeof(buf), "sensor_%d", i); @@ -337,14 +330,14 @@ int igb_procfs_init(struct igb_adapter *adapter) * will be needing */ adapter->therm_data[i].hw = &adapter->hw; - adapter->therm_data[i].sensor_data = + adapter->therm_data[i].sensor_data = &adapter->hw.mac.thermal_sensor_data.sensor[i]; if (!(create_proc_read_entry( - igb_internal_entries[index].name, - 0444, - adapter->therm_dir[i], - igb_internal_entries[index].read, + igb_internal_entries[index].name, + 0444, + adapter->therm_dir[i], + igb_internal_entries[index].read, &adapter->therm_data[i]))) { rc = -ENOMEM; goto fail; |