Skip to contentSkip to conversation

qla4xxx: added IPv6 support.

PATCH In review Ravi Anand 1 participant 1 message Apr 6, 2010

Subsystems (2)
lore
Share & tools
lore

Ravi Anand

author
#0 lore raw

PATCH 2/12 qla4xxx: added IPv6 support.

From: Vikas Chaudhary <[email protected]>

---
 drivers/scsi/qla4xxx/ql4_def.h  |   40 +++++-
 drivers/scsi/qla4xxx/ql4_fw.h   |   45 +++++-
 drivers/scsi/qla4xxx/ql4_init.c |  218 ++++++++++++++++++++++++------
 drivers/scsi/qla4xxx/ql4_mbx.c  |  284 ++++++++++++++++++++++++++-------------
 4 files changed, 445 insertions(+), 142 deletions(-)
drivers/scsi/qla4xxx/ql4_def.h +38 -2
index 38e261d..bbd9352 100644
@@ -114,6 +114,7 @@
  */
 #define MAC_ADDR_LEN                   6       /* in bytes */
 #define IP_ADDR_LEN                    4       /* in bytes */
+#define IPv6_ADDR_LEN                  16      /* IPv6 address size */
 #define DRIVER_NAME                    "qla4xxx"
 
 #define MAX_LINKED_CMDS_PER_LUN                3
@@ -221,7 +222,7 @@ struct ddb_entry {
 
        uint16_t os_target_id;  /* Target ID */
        uint16_t fw_ddb_index;  /* DDB firmware index */
-       uint8_t reserved[2];
+       uint8_t options;
        uint32_t fw_ddb_device_state; /* F/W Device State  -- see ql4_fw.h */
 
        uint32_t CmdSn;
@@ -246,10 +247,18 @@ struct ddb_entry {
 
        uint16_t port;
        uint32_t tpgt;
-       uint8_t ip_addr[ISCSI_IPADDR_SIZE];
+       uint8_t ip_addr[IP_ADDR_LEN];
        uint8_t iscsi_name[ISCSI_NAME_SIZE];    /* 72 x48 */
        uint8_t iscsi_alias[0x20];
        uint8_t isid[6];
+       uint16_t iscsi_max_burst_len;
+       uint16_t iscsi_max_outsnd_r2t;
+       uint16_t iscsi_first_burst_len;
+       uint16_t iscsi_max_rcv_data_seg_len;
+       uint16_t iscsi_max_snd_data_seg_len;
+
+       struct in6_addr remote_ipv6_addr;
+       struct in6_addr link_local_ipv6_addr;
 };
 
 /*
@@ -442,8 +451,35 @@ struct scsi_qla_host {
 
        /* Saved srb for status continuation entry processing */
        struct srb *status_srb;
+
+       /* IPv6 support info from InitFW */
+       uint8_t acb_version;
+       uint8_t ipv4_addr_state;
+       uint16_t ipv4_options;
+
+       uint32_t resvd2;
+       uint32_t ipv6_options;
+       uint32_t ipv6_addl_options;
+       uint8_t ipv6_link_local_state;
+       uint8_t ipv6_addr0_state;
+       uint8_t ipv6_addr1_state;
+       uint8_t ipv6_default_router_state;
+       struct in6_addr ipv6_link_local_addr;
+       struct in6_addr ipv6_addr0;
+       struct in6_addr ipv6_addr1;
+       struct in6_addr ipv6_default_router_addr;
 };
 
+static inline int is_ipv4_enabled(struct scsi_qla_host *ha)
+{
+       return ((ha->ipv4_options & IPOPT_IPv4_PROTOCOL_ENABLE) != 0);
+}
+
+static inline int is_ipv6_enabled(struct scsi_qla_host *ha)
+{
+       return ((ha->ipv6_options & IPV6_OPT_IPV6_PROTOCOL_ENABLE) != 0);
+}
+
 static inline int is_qla4010(struct scsi_qla_host *ha)
 {
        return ha->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP4010;
drivers/scsi/qla4xxx/ql4_fw.h +38 -7

104 lines not on this page · raw message

drivers/scsi/qla4xxx/ql4_init.c +178 -40

261 lines not on this page · raw message

drivers/scsi/qla4xxx/ql4_mbx.c +191 -93

367 lines not on this page · raw message

--
1.6.0.2

----- End forwarded message -----