]> err.no Git - linux-2.6/blobdiff - drivers/net/sfc/net_driver.h
sfc: Use a separate workqueue for resets
[linux-2.6] / drivers / net / sfc / net_driver.h
index 18b21ef230143f0ad52b766406fc45c87dba92e7..219c74a772c32deb333b62bef44b3dd2422f18ba 100644 (file)
 #include <linux/highmem.h>
 #include <linux/workqueue.h>
 #include <linux/inet_lro.h>
+#include <linux/i2c.h>
 
 #include "enum.h"
 #include "bitfield.h"
-#include "i2c-direct.h"
 
 #define EFX_MAX_LRO_DESCRIPTORS 8
 #define EFX_MAX_LRO_AGGR MAX_SKB_FRAGS
@@ -42,7 +42,7 @@
 #ifndef EFX_DRIVER_NAME
 #define EFX_DRIVER_NAME        "sfc"
 #endif
-#define EFX_DRIVER_VERSION     "2.2.0136"
+#define EFX_DRIVER_VERSION     "2.2"
 
 #ifdef EFX_ENABLE_DEBUG
 #define EFX_BUG_ON_PARANOID(x) BUG_ON(x)
@@ -81,11 +81,6 @@ do {if (net_ratelimit()) EFX_INFO(efx, fmt, ##args); } while (0)
 #define EFX_LOG_RL(efx, fmt, args...) \
 do {if (net_ratelimit()) EFX_LOG(efx, fmt, ##args); } while (0)
 
-/* Kernel headers may redefine inline anyway */
-#ifndef inline
-#define inline inline __attribute__ ((always_inline))
-#endif
-
 /**************************************************************************
  *
  * Efx data structures
@@ -423,7 +418,10 @@ struct efx_blinker {
  * @init_leds: Sets up board LEDs
  * @set_fault_led: Turns the fault LED on or off
  * @blink: Starts/stops blinking
+ * @fini: Cleanup function
  * @blinker: used to blink LEDs in software
+ * @hwmon_client: I2C client for hardware monitor
+ * @ioexp_client: I2C client for power/port control
  */
 struct efx_board {
        int type;
@@ -436,7 +434,9 @@ struct efx_board {
        int (*init_leds)(struct efx_nic *efx);
        void (*set_fault_led) (struct efx_nic *efx, int state);
        void (*blink) (struct efx_nic *efx, int start);
+       void (*fini) (struct efx_nic *nic);
        struct efx_blinker blinker;
+       struct i2c_client *hwmon_client, *ioexp_client;
 };
 
 #define STRING_TABLE_LOOKUP(val, member)       \
@@ -616,14 +616,16 @@ union efx_multicast_hash {
  * @pci_dev: The PCI device
  * @type: Controller type attributes
  * @legacy_irq: IRQ number
- * @workqueue: Workqueue for resets, port reconfigures and the HW monitor
+ * @workqueue: Workqueue for port reconfigures and the HW monitor.
+ *     Work items do not hold and must not acquire RTNL.
+ * @reset_workqueue: Workqueue for resets.  Work item will acquire RTNL.
  * @reset_work: Scheduled reset workitem
  * @monitor_work: Hardware monitor workitem
  * @membase_phys: Memory BAR value as physical address
  * @membase: Memory BAR value
  * @biu_lock: BIU (bus interface unit) lock
  * @interrupt_mode: Interrupt mode
- * @i2c: I2C interface
+ * @i2c_adap: I2C adapter
  * @board_info: Board-level information
  * @state: Device state flag. Serialised by the rtnl_lock.
  * @reset_pending: Pending reset method (normally RESET_TYPE_NONE)
@@ -684,14 +686,15 @@ struct efx_nic {
        const struct efx_nic_type *type;
        int legacy_irq;
        struct workqueue_struct *workqueue;
+       struct workqueue_struct *reset_workqueue;
        struct work_struct reset_work;
        struct delayed_work monitor_work;
-       unsigned long membase_phys;
+       resource_size_t membase_phys;
        void __iomem *membase;
        spinlock_t biu_lock;
        enum efx_int_mode interrupt_mode;
 
-       struct efx_i2c_interface i2c;
+       struct i2c_adapter i2c_adap;
        struct efx_board board_info;
 
        enum nic_state state;
@@ -710,7 +713,7 @@ struct efx_nic {
 
        unsigned n_rx_nodesc_drop_cnt;
 
-       void *nic_data;
+       struct falcon_nic_data *nic_data;
 
        struct mutex mac_lock;
        int port_enabled;
@@ -800,7 +803,7 @@ struct efx_nic_type {
        unsigned int txd_ring_mask;
        unsigned int rxd_ring_mask;
        unsigned int evq_size;
-       dma_addr_t max_dma_mask;
+       u64 max_dma_mask;
        unsigned int tx_dma_mask;
        unsigned bug5391_mask;