]> err.no Git - linux-2.6/blobdiff - drivers/net/ixgb/ixgb.h
Merge branch 'master' of /home/cbou/linux-2.6
[linux-2.6] / drivers / net / ixgb / ixgb.h
index 3d2e7217e9af04a9afd5beac494d67b0761255a8..804698fc6a8fdb2f663c747f54960e8af3116a22 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel PRO/10GbE Linux driver
-  Copyright(c) 1999 - 2006 Intel Corporation.
+  Copyright(c) 1999 - 2008 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,
@@ -89,18 +89,16 @@ struct ixgb_adapter;
 
 
 /* TX/RX descriptor defines */
-#define DEFAULT_TXD     256
-#define MAX_TXD        4096
-#define MIN_TXD          64
+#define DEFAULT_TXD      256
+#define MAX_TXD         4096
+#define MIN_TXD           64
 
 /* hardware cannot reliably support more than 512 descriptors owned by
- * hardware descrioptor cache otherwise an unreliable ring under heavy 
- * recieve load may result */
-/* #define DEFAULT_RXD    1024 */
-/* #define MAX_RXD        4096 */
-#define DEFAULT_RXD    512
-#define MAX_RXD        512
-#define MIN_RXD         64
+ * hardware descriptor cache otherwise an unreliable ring under heavy
+ * receive load may result */
+#define DEFAULT_RXD      512
+#define MAX_RXD          512
+#define MIN_RXD           64
 
 /* Supported Rx Buffer Sizes */
 #define IXGB_RXBUFFER_2048  2048
@@ -117,8 +115,8 @@ struct ixgb_buffer {
        struct sk_buff *skb;
        dma_addr_t dma;
        unsigned long time_stamp;
-       uint16_t length;
-       uint16_t next_to_watch;
+       u16 length;
+       u16 next_to_watch;
 };
 
 struct ixgb_desc_ring {
@@ -152,13 +150,11 @@ struct ixgb_desc_ring {
 struct ixgb_adapter {
        struct timer_list watchdog_timer;
        struct vlan_group *vlgrp;
-       uint32_t bd_number;
-       uint32_t rx_buffer_len;
-       uint32_t part_num;
-       uint16_t link_speed;
-       uint16_t link_duplex;
-       spinlock_t tx_lock;
-       atomic_t irq_sem;
+       u32 bd_number;
+       u32 rx_buffer_len;
+       u32 part_num;
+       u16 link_speed;
+       u16 link_duplex;
        struct work_struct tx_timeout_task;
 
        struct timer_list blink_timer;
@@ -168,20 +164,20 @@ struct ixgb_adapter {
        struct ixgb_desc_ring tx_ring ____cacheline_aligned_in_smp;
        unsigned int restart_queue;
        unsigned long timeo_start;
-       uint32_t tx_cmd_type;
-       uint64_t hw_csum_tx_good;
-       uint64_t hw_csum_tx_error;
-       uint32_t tx_int_delay;
-       uint32_t tx_timeout_count;
-       boolean_t tx_int_delay_enable;
-       boolean_t detect_tx_hung;
+       u32 tx_cmd_type;
+       u64 hw_csum_tx_good;
+       u64 hw_csum_tx_error;
+       u32 tx_int_delay;
+       u32 tx_timeout_count;
+       bool tx_int_delay_enable;
+       bool detect_tx_hung;
 
        /* RX */
        struct ixgb_desc_ring rx_ring;
-       uint64_t hw_csum_rx_error;
-       uint64_t hw_csum_rx_good;
-       uint32_t rx_int_delay;
-       boolean_t rx_csum;
+       u64 hw_csum_rx_error;
+       u64 hw_csum_rx_good;
+       u32 rx_int_delay;
+       bool rx_csum;
 
        /* OS defined structs */
        struct napi_struct napi;
@@ -193,8 +189,17 @@ struct ixgb_adapter {
        struct ixgb_hw hw;
        u16 msg_enable;
        struct ixgb_hw_stats stats;
-       uint32_t alloc_rx_buff_failed;
-       boolean_t have_msi;
+       u32 alloc_rx_buff_failed;
+       bool have_msi;
+       unsigned long flags;
+};
+
+enum ixgb_state_t {
+       /* TBD
+       __IXGB_TESTING,
+       __IXGB_RESETTING,
+       */
+       __IXGB_DOWN
 };
 
 /* Exported from other modules */
@@ -203,4 +208,14 @@ extern void ixgb_set_ethtool_ops(struct net_device *netdev);
 extern char ixgb_driver_name[];
 extern const char ixgb_driver_version[];
 
+extern int ixgb_up(struct ixgb_adapter *adapter);
+extern void ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog);
+extern void ixgb_reset(struct ixgb_adapter *adapter);
+extern int ixgb_setup_rx_resources(struct ixgb_adapter *adapter);
+extern int ixgb_setup_tx_resources(struct ixgb_adapter *adapter);
+extern void ixgb_free_rx_resources(struct ixgb_adapter *adapter);
+extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter);
+extern void ixgb_update_stats(struct ixgb_adapter *adapter);
+
+
 #endif /* _IXGB_H_ */