internal.h (30596ec32e2cd141d73ee8701386887def9e98c0) | internal.h (062b3e1b6d4f2a33c1d0fd7ae9b4550da5cf7e4b) |
---|---|
1/* 2 * Copyright Gavin Shan, IBM Corporation 2016. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ --- 54 unchanged lines hidden (view full) --- 63 NCSI_MODE_VLAN, 64 NCSI_MODE_BC, 65 NCSI_MODE_MC, 66 NCSI_MODE_AEN, 67 NCSI_MODE_FC, 68 NCSI_MODE_MAX 69}; 70 | 1/* 2 * Copyright Gavin Shan, IBM Corporation 2016. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ --- 54 unchanged lines hidden (view full) --- 63 NCSI_MODE_VLAN, 64 NCSI_MODE_BC, 65 NCSI_MODE_MC, 66 NCSI_MODE_AEN, 67 NCSI_MODE_FC, 68 NCSI_MODE_MAX 69}; 70 |
71enum { 72 NCSI_FILTER_BASE = 0, 73 NCSI_FILTER_VLAN = 0, 74 NCSI_FILTER_UC, 75 NCSI_FILTER_MC, 76 NCSI_FILTER_MIXED, 77 NCSI_FILTER_MAX 78}; 79 | |
80struct ncsi_channel_version { 81 u32 version; /* Supported BCD encoded NCSI version */ 82 u32 alpha2; /* Supported BCD encoded NCSI version */ 83 u8 fw_name[12]; /* Firware name string */ 84 u32 fw_version; /* Firmware version */ 85 u16 pci_ids[4]; /* PCI identification */ 86 u32 mf_id; /* Manufacture ID */ 87}; --- 5 unchanged lines hidden (view full) --- 93 94struct ncsi_channel_mode { 95 u32 index; /* Index of channel modes */ 96 u32 enable; /* Enabled or disabled */ 97 u32 size; /* Valid entries in ncm_data[] */ 98 u32 data[8]; /* Data entries */ 99}; 100 | 71struct ncsi_channel_version { 72 u32 version; /* Supported BCD encoded NCSI version */ 73 u32 alpha2; /* Supported BCD encoded NCSI version */ 74 u8 fw_name[12]; /* Firware name string */ 75 u32 fw_version; /* Firmware version */ 76 u16 pci_ids[4]; /* PCI identification */ 77 u32 mf_id; /* Manufacture ID */ 78}; --- 5 unchanged lines hidden (view full) --- 84 85struct ncsi_channel_mode { 86 u32 index; /* Index of channel modes */ 87 u32 enable; /* Enabled or disabled */ 88 u32 size; /* Valid entries in ncm_data[] */ 89 u32 data[8]; /* Data entries */ 90}; 91 |
101struct ncsi_channel_filter { 102 u32 index; /* Index of channel filters */ 103 u32 total; /* Total entries in the filter table */ 104 u64 bitmap; /* Bitmap of valid entries */ 105 u32 data[]; /* Data for the valid entries */ | 92struct ncsi_channel_mac_filter { 93 u8 n_uc; 94 u8 n_mc; 95 u8 n_mixed; 96 u64 bitmap; 97 unsigned char *addrs; |
106}; 107 | 98}; 99 |
100struct ncsi_channel_vlan_filter { 101 u8 n_vids; 102 u64 bitmap; 103 u16 *vids; 104}; 105 |
|
108struct ncsi_channel_stats { 109 u32 hnc_cnt_hi; /* Counter cleared */ 110 u32 hnc_cnt_lo; /* Counter cleared */ 111 u32 hnc_rx_bytes; /* Rx bytes */ 112 u32 hnc_tx_bytes; /* Tx bytes */ 113 u32 hnc_rx_uc_pkts; /* Rx UC packets */ 114 u32 hnc_rx_mc_pkts; /* Rx MC packets */ 115 u32 hnc_rx_bc_pkts; /* Rx BC packets */ --- 65 unchanged lines hidden (view full) --- 181#define NCSI_CHANNEL_ACTIVE 2 182#define NCSI_CHANNEL_INVISIBLE 3 183 bool reconfigure_needed; 184 spinlock_t lock; /* Protect filters etc */ 185 struct ncsi_package *package; 186 struct ncsi_channel_version version; 187 struct ncsi_channel_cap caps[NCSI_CAP_MAX]; 188 struct ncsi_channel_mode modes[NCSI_MODE_MAX]; | 106struct ncsi_channel_stats { 107 u32 hnc_cnt_hi; /* Counter cleared */ 108 u32 hnc_cnt_lo; /* Counter cleared */ 109 u32 hnc_rx_bytes; /* Rx bytes */ 110 u32 hnc_tx_bytes; /* Tx bytes */ 111 u32 hnc_rx_uc_pkts; /* Rx UC packets */ 112 u32 hnc_rx_mc_pkts; /* Rx MC packets */ 113 u32 hnc_rx_bc_pkts; /* Rx BC packets */ --- 65 unchanged lines hidden (view full) --- 179#define NCSI_CHANNEL_ACTIVE 2 180#define NCSI_CHANNEL_INVISIBLE 3 181 bool reconfigure_needed; 182 spinlock_t lock; /* Protect filters etc */ 183 struct ncsi_package *package; 184 struct ncsi_channel_version version; 185 struct ncsi_channel_cap caps[NCSI_CAP_MAX]; 186 struct ncsi_channel_mode modes[NCSI_MODE_MAX]; |
189 struct ncsi_channel_filter *filters[NCSI_FILTER_MAX]; | 187 /* Filtering Settings */ 188 struct ncsi_channel_mac_filter mac_filter; 189 struct ncsi_channel_vlan_filter vlan_filter; |
190 struct ncsi_channel_stats stats; 191 struct { 192 struct timer_list timer; 193 bool enabled; 194 unsigned int state; 195#define NCSI_CHANNEL_MONITOR_START 0 196#define NCSI_CHANNEL_MONITOR_RETRY 1 197#define NCSI_CHANNEL_MONITOR_WAIT 2 --- 117 unchanged lines hidden (view full) --- 315#define NCSI_FOR_EACH_DEV(ndp) \ 316 list_for_each_entry_rcu(ndp, &ncsi_dev_list, node) 317#define NCSI_FOR_EACH_PACKAGE(ndp, np) \ 318 list_for_each_entry_rcu(np, &ndp->packages, node) 319#define NCSI_FOR_EACH_CHANNEL(np, nc) \ 320 list_for_each_entry_rcu(nc, &np->channels, node) 321 322/* Resources */ | 190 struct ncsi_channel_stats stats; 191 struct { 192 struct timer_list timer; 193 bool enabled; 194 unsigned int state; 195#define NCSI_CHANNEL_MONITOR_START 0 196#define NCSI_CHANNEL_MONITOR_RETRY 1 197#define NCSI_CHANNEL_MONITOR_WAIT 2 --- 117 unchanged lines hidden (view full) --- 315#define NCSI_FOR_EACH_DEV(ndp) \ 316 list_for_each_entry_rcu(ndp, &ncsi_dev_list, node) 317#define NCSI_FOR_EACH_PACKAGE(ndp, np) \ 318 list_for_each_entry_rcu(np, &ndp->packages, node) 319#define NCSI_FOR_EACH_CHANNEL(np, nc) \ 320 list_for_each_entry_rcu(nc, &np->channels, node) 321 322/* Resources */ |
323u32 *ncsi_get_filter(struct ncsi_channel *nc, int table, int index); 324int ncsi_find_filter(struct ncsi_channel *nc, int table, void *data); 325int ncsi_add_filter(struct ncsi_channel *nc, int table, void *data); 326int ncsi_remove_filter(struct ncsi_channel *nc, int table, int index); | |
327void ncsi_start_channel_monitor(struct ncsi_channel *nc); 328void ncsi_stop_channel_monitor(struct ncsi_channel *nc); 329struct ncsi_channel *ncsi_find_channel(struct ncsi_package *np, 330 unsigned char id); 331struct ncsi_channel *ncsi_add_channel(struct ncsi_package *np, 332 unsigned char id); 333struct ncsi_package *ncsi_find_package(struct ncsi_dev_priv *ndp, 334 unsigned char id); --- 21 unchanged lines hidden --- | 323void ncsi_start_channel_monitor(struct ncsi_channel *nc); 324void ncsi_stop_channel_monitor(struct ncsi_channel *nc); 325struct ncsi_channel *ncsi_find_channel(struct ncsi_package *np, 326 unsigned char id); 327struct ncsi_channel *ncsi_add_channel(struct ncsi_package *np, 328 unsigned char id); 329struct ncsi_package *ncsi_find_package(struct ncsi_dev_priv *ndp, 330 unsigned char id); --- 21 unchanged lines hidden --- |