sfc: Allow resets to be upgraded; use atomic ops for safety
[pandora-kernel.git] / drivers / net / sfc / net_driver.h
index 9ffa9a6..c422eb2 100644 (file)
@@ -330,7 +330,6 @@ enum efx_rx_alloc_method {
  * @eventq_mask: Event queue pointer mask
  * @eventq_read_ptr: Event queue read pointer
  * @last_eventq_read_ptr: Last event queue read pointer value.
- * @magic_count: Event queue test event count
  * @irq_count: Number of IRQs since last adaptive moderation decision
  * @irq_mod_score: IRQ moderation score
  * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
@@ -360,7 +359,6 @@ struct efx_channel {
        unsigned int eventq_mask;
        unsigned int eventq_read_ptr;
        unsigned int last_eventq_read_ptr;
-       unsigned int magic_count;
 
        unsigned int irq_count;
        unsigned int irq_mod_score;
@@ -451,11 +449,9 @@ enum nic_state {
 struct efx_nic;
 
 /* Pseudo bit-mask flow control field */
-enum efx_fc_type {
-       EFX_FC_RX = FLOW_CTRL_RX,
-       EFX_FC_TX = FLOW_CTRL_TX,
-       EFX_FC_AUTO = 4,
-};
+#define EFX_FC_RX      FLOW_CTRL_RX
+#define EFX_FC_TX      FLOW_CTRL_TX
+#define EFX_FC_AUTO    4
 
 /**
  * struct efx_link_state - Current state of the link
@@ -467,7 +463,7 @@ enum efx_fc_type {
 struct efx_link_state {
        bool up;
        bool fd;
-       enum efx_fc_type fc;
+       u8 fc;
        unsigned int speed;
 };
 
@@ -649,7 +645,7 @@ struct efx_filter_state;
  * @irq_rx_moderation: IRQ moderation time for RX event queues
  * @msg_enable: Log message enable flags
  * @state: Device state flag. Serialised by the rtnl_lock.
- * @reset_pending: Pending reset method (normally RESET_TYPE_NONE)
+ * @reset_pending: Bitmask for pending resets
  * @tx_queue: TX DMA queues
  * @rx_queue: RX DMA queues
  * @channel: Channels
@@ -672,16 +668,14 @@ struct efx_filter_state;
  * @mtd_list: List of MTDs attached to the NIC
  * @nic_data: Hardware dependent state
  * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode,
- *     @port_inhibited, efx_monitor() and efx_reconfigure_port()
+ *     efx_monitor() and efx_reconfigure_port()
  * @port_enabled: Port enabled indicator.
  *     Serialises efx_stop_all(), efx_start_all(), efx_monitor() and
  *     efx_mac_work() with kernel interfaces. Safe to read under any
  *     one of the rtnl_lock, mac_lock, or netif_tx_lock, but all three must
  *     be held to modify it.
- * @port_inhibited: If set, the netif_carrier is always off. Hold the mac_lock
  * @port_initialized: Port initialized?
  * @net_dev: Operating system network device. Consider holding the rtnl lock
- * @rx_checksum_enabled: RX checksumming enabled
  * @stats_buffer: DMA buffer for statistics
  * @mac_op: MAC interface
  * @phy_type: PHY type
@@ -734,7 +728,7 @@ struct efx_nic {
        u32 msg_enable;
 
        enum nic_state state;
-       enum reset_type reset_pending;
+       unsigned long reset_pending;
 
        struct efx_channel *channel[EFX_MAX_CHANNELS];
        char channel_name[EFX_MAX_CHANNELS][IFNAMSIZ + 6];
@@ -767,18 +761,16 @@ struct efx_nic {
        struct mutex mac_lock;
        struct work_struct mac_work;
        bool port_enabled;
-       bool port_inhibited;
 
        bool port_initialized;
        struct net_device *net_dev;
-       bool rx_checksum_enabled;
 
        struct efx_buffer stats_buffer;
 
-       struct efx_mac_operations *mac_op;
+       const struct efx_mac_operations *mac_op;
 
        unsigned int phy_type;
-       struct efx_phy_operations *phy_op;
+       const struct efx_phy_operations *phy_op;
        void *phy_data;
        struct mdio_if_info mdio;
        unsigned int mdio_bus;
@@ -790,7 +782,7 @@ struct efx_nic {
 
        bool promiscuous;
        union efx_multicast_hash multicast_hash;
-       enum efx_fc_type wanted_fc;
+       u8 wanted_fc;
 
        atomic_t rx_reset;
        enum efx_loopback_mode loopback_mode;
@@ -899,7 +891,7 @@ struct efx_nic_type {
        void (*resume_wol)(struct efx_nic *efx);
        int (*test_registers)(struct efx_nic *efx);
        int (*test_nvram)(struct efx_nic *efx);
-       struct efx_mac_operations *default_mac_ops;
+       const struct efx_mac_operations *default_mac_ops;
 
        int revision;
        unsigned int mem_map_size;