37 static void qla4xxx_advance_req_ring_ptr(
struct scsi_qla_host *ha)
60 struct queue_entry **queue_entry)
64 if (qla4xxx_space_in_req_ring(ha, req_cnt)) {
66 memset(*queue_entry, 0,
sizeof(**queue_entry));
68 qla4xxx_advance_req_ring_ptr(ha);
89 unsigned long flags = 0;
96 if (qla4xxx_get_req_pkt(ha, (
struct queue_entry **) &marker_entry) !=
99 goto exit_send_marker;
104 marker_entry->
hdr.entryCount = 1;
114 spin_unlock_irqrestore(&ha->hardware_lock, flags);
125 qla4xxx_advance_req_ring_ptr(ha);
129 cont_entry->
hdr.entryCount = 1;
148 static void qla4xxx_build_scsi_iocbs(
struct srb *
srb,
175 if (avail_dsds == 0) {
178 cont_entry = qla4xxx_alloc_cont_entry(ha);
219 dbval = dbval | (0 << 8) | (ha->
request_in << 16);
286 ddb_entry = srb->
ddb;
303 "Do not issue command.\n",
314 req_cnt = qla4xxx_calc_request_entries(tot_dsds);
315 if (!qla4xxx_space_in_req_ring(ha, req_cnt))
333 cmd_entry->
hdr.entryCount = req_cnt;
340 if (scsi_bufflen(cmd)) {
355 if (scsi_populate_tag_msg(cmd, tag))
365 qla4xxx_advance_req_ring_ptr(ha);
366 qla4xxx_build_scsi_iocbs(srb, cmd_entry, tot_dsds);
369 srb->
cmd->host_scribble = (
unsigned char *)(
unsigned long)
index;
381 spin_unlock_irqrestore(&ha->hardware_lock, flags);
389 spin_unlock_irqrestore(&ha->hardware_lock, flags);
408 if (!qla4xxx_space_in_req_ring(ha, task_data->
iocb_req_cnt))
426 passthru_iocb->
out_dsd.base.addrLow =
428 passthru_iocb->
out_dsd.base.addrHigh =
435 passthru_iocb->
in_dsd.base.addrLow =
437 passthru_iocb->
in_dsd.base.addrHigh =
439 passthru_iocb->
in_dsd.count =
447 qla4xxx_advance_req_ring_ptr(ha);
457 spin_unlock_irqrestore(&ha->hardware_lock, flags);
473 static int qla4xxx_send_mbox_iocb(
struct scsi_qla_host *ha,
struct mrb *mrb,
485 rval = qla4xxx_get_req_pkt(ha, (
struct queue_entry **) &(mrb->
mbox));
491 for (i = 0; i <
MAX_MRB; i++) {
493 if (index == MAX_MRB)
512 spin_unlock_irqrestore(&ha->hardware_lock, flags);
520 struct mrb *mrb =
NULL;
523 memset(in_mbox, 0,
sizeof(in_mbox));
525 mrb = qla4xxx_get_new_mrb(ha);
535 memcpy(&in_mbox[2], &ipaddr[0], 4);
536 memcpy(&in_mbox[3], &ipaddr[4], 4);
537 memcpy(&in_mbox[4], &ipaddr[8], 4);
538 memcpy(&in_mbox[5], &ipaddr[12], 4);
542 rval = qla4xxx_send_mbox_iocb(ha, mrb, in_mbox);