@@ -60,6 +60,8 @@ static int qla4xxx_conn_get_param(struct iscsi_cls_conn *conn,
6060 enum iscsi_param param , char * buf );
6161static int qla4xxx_sess_get_param (struct iscsi_cls_session * sess ,
6262 enum iscsi_param param , char * buf );
63+ static int qla4xxx_host_get_param (struct Scsi_Host * shost ,
64+ enum iscsi_host_param param , char * buf );
6365static void qla4xxx_conn_stop (struct iscsi_cls_conn * conn , int flag );
6466static int qla4xxx_conn_start (struct iscsi_cls_conn * conn );
6567static void qla4xxx_recovery_timedout (struct iscsi_cls_session * session );
@@ -99,16 +101,16 @@ static struct scsi_host_template qla4xxx_driver_template = {
99101static struct iscsi_transport qla4xxx_iscsi_transport = {
100102 .owner = THIS_MODULE ,
101103 .name = DRIVER_NAME ,
102- .param_mask = ISCSI_CONN_PORT |
103- ISCSI_CONN_ADDRESS |
104- ISCSI_TARGET_NAME |
105- ISCSI_TPGT ,
104+ .param_mask = ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS |
105+ ISCSI_TARGET_NAME | ISCSI_TPGT ,
106+ .host_param_mask = ISCSI_HOST_HWADDRESS ,
106107 .sessiondata_size = sizeof (struct ddb_entry ),
107108 .host_template = & qla4xxx_driver_template ,
108109
109110 .tgt_dscvr = qla4xxx_tgt_dscvr ,
110111 .get_conn_param = qla4xxx_conn_get_param ,
111112 .get_session_param = qla4xxx_sess_get_param ,
113+ .get_host_param = qla4xxx_host_get_param ,
112114 .start_conn = qla4xxx_conn_start ,
113115 .stop_conn = qla4xxx_conn_stop ,
114116 .session_recovery_timedout = qla4xxx_recovery_timedout ,
@@ -165,6 +167,35 @@ static void qla4xxx_conn_stop(struct iscsi_cls_conn *conn, int flag)
165167 printk (KERN_ERR "iscsi: invalid stop flag %d\n" , flag );
166168}
167169
170+ static ssize_t format_addr (char * buf , const unsigned char * addr , int len )
171+ {
172+ int i ;
173+ char * cp = buf ;
174+
175+ for (i = 0 ; i < len ; i ++ )
176+ cp += sprintf (cp , "%02x%c" , addr [i ],
177+ i == (len - 1 ) ? '\n' : ':' );
178+ return cp - buf ;
179+ }
180+
181+
182+ static int qla4xxx_host_get_param (struct Scsi_Host * shost ,
183+ enum iscsi_host_param param , char * buf )
184+ {
185+ struct scsi_qla_host * ha = to_qla_host (shost );
186+ int len ;
187+
188+ switch (param ) {
189+ case ISCSI_HOST_PARAM_HWADDRESS :
190+ len = format_addr (buf , ha -> my_mac , MAC_ADDR_LEN );
191+ break ;
192+ default :
193+ return - ENOSYS ;
194+ }
195+
196+ return len ;
197+ }
198+
168199static int qla4xxx_sess_get_param (struct iscsi_cls_session * sess ,
169200 enum iscsi_param param , char * buf )
170201{
0 commit comments