Lines Matching refs:snic
40 struct snic *snic = container_of(work, struct snic, link_work); in snic_handle_link() local
42 if (snic->config.xpt_type == SNIC_DAS) in snic_handle_link()
45 snic->link_status = svnic_dev_link_status(snic->vdev); in snic_handle_link()
46 snic->link_down_cnt = svnic_dev_link_down_cnt(snic->vdev); in snic_handle_link()
47 SNIC_HOST_INFO(snic->shost, "Link Event: Link %s.\n", in snic_handle_link()
48 ((snic->link_status) ? "Up" : "Down")); in snic_handle_link()
106 snic_queue_exch_ver_req(struct snic *snic) in snic_queue_exch_ver_req() argument
113 SNIC_HOST_INFO(snic->shost, "Exch Ver Req Preparing...\n"); in snic_queue_exch_ver_req()
115 rqi = snic_req_init(snic, 0); in snic_queue_exch_ver_req()
117 SNIC_HOST_ERR(snic->shost, in snic_queue_exch_ver_req()
129 snic->config.hid, 0, (ulong)rqi); in snic_queue_exch_ver_req()
134 snic_handle_untagged_req(snic, rqi); in snic_queue_exch_ver_req()
136 ret = snic_queue_wq_desc(snic, req, sizeof(*req)); in snic_queue_exch_ver_req()
138 snic_release_untagged_req(snic, rqi); in snic_queue_exch_ver_req()
139 SNIC_HOST_ERR(snic->shost, in snic_queue_exch_ver_req()
145 SNIC_HOST_INFO(snic->shost, "Exch Ver Req is issued. ret = %d\n", ret); in snic_queue_exch_ver_req()
155 snic_io_exch_ver_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_io_exch_ver_cmpl_handler() argument
165 SNIC_HOST_INFO(snic->shost, "Exch Ver Compl Received.\n"); in snic_io_exch_ver_cmpl_handler()
167 SNIC_BUG_ON(snic->config.hid != hid); in snic_io_exch_ver_cmpl_handler()
171 SNIC_HOST_ERR(snic->shost, in snic_io_exch_ver_cmpl_handler()
178 spin_lock_irqsave(&snic->snic_lock, flags); in snic_io_exch_ver_cmpl_handler()
179 snic->fwinfo.fw_ver = le32_to_cpu(exv_cmpl->version); in snic_io_exch_ver_cmpl_handler()
180 snic->fwinfo.hid = le32_to_cpu(exv_cmpl->hid); in snic_io_exch_ver_cmpl_handler()
181 snic->fwinfo.max_concur_ios = le32_to_cpu(exv_cmpl->max_concur_ios); in snic_io_exch_ver_cmpl_handler()
182 snic->fwinfo.max_sgs_per_cmd = le32_to_cpu(exv_cmpl->max_sgs_per_cmd); in snic_io_exch_ver_cmpl_handler()
183 snic->fwinfo.max_io_sz = le32_to_cpu(exv_cmpl->max_io_sz); in snic_io_exch_ver_cmpl_handler()
184 snic->fwinfo.max_tgts = le32_to_cpu(exv_cmpl->max_tgts); in snic_io_exch_ver_cmpl_handler()
185 snic->fwinfo.io_tmo = le16_to_cpu(exv_cmpl->io_timeout); in snic_io_exch_ver_cmpl_handler()
187 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
189 snic->fwinfo.fw_ver, in snic_io_exch_ver_cmpl_handler()
190 snic->fwinfo.hid, in snic_io_exch_ver_cmpl_handler()
191 snic->fwinfo.max_concur_ios, in snic_io_exch_ver_cmpl_handler()
192 snic->fwinfo.max_sgs_per_cmd, in snic_io_exch_ver_cmpl_handler()
193 snic->fwinfo.max_io_sz, in snic_io_exch_ver_cmpl_handler()
194 snic->fwinfo.max_tgts, in snic_io_exch_ver_cmpl_handler()
195 snic->fwinfo.io_tmo); in snic_io_exch_ver_cmpl_handler()
197 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
202 max_sgs = snic->fwinfo.max_sgs_per_cmd; in snic_io_exch_ver_cmpl_handler()
204 snic->shost->sg_tablesize = max_sgs; in snic_io_exch_ver_cmpl_handler()
205 SNIC_HOST_INFO(snic->shost, "Max SGs set to %d\n", in snic_io_exch_ver_cmpl_handler()
206 snic->shost->sg_tablesize); in snic_io_exch_ver_cmpl_handler()
207 } else if (max_sgs > snic->shost->sg_tablesize) { in snic_io_exch_ver_cmpl_handler()
208 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
210 snic->config.xpt_type, max_sgs, in snic_io_exch_ver_cmpl_handler()
211 snic->shost->sg_tablesize); in snic_io_exch_ver_cmpl_handler()
214 if (snic->shost->can_queue > snic->fwinfo.max_concur_ios) in snic_io_exch_ver_cmpl_handler()
215 snic->shost->can_queue = snic->fwinfo.max_concur_ios; in snic_io_exch_ver_cmpl_handler()
217 snic->shost->max_sectors = snic->fwinfo.max_io_sz >> 9; in snic_io_exch_ver_cmpl_handler()
218 if (snic->fwinfo.wait) in snic_io_exch_ver_cmpl_handler()
219 complete(snic->fwinfo.wait); in snic_io_exch_ver_cmpl_handler()
221 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_io_exch_ver_cmpl_handler()
224 snic_release_untagged_req(snic, rqi); in snic_io_exch_ver_cmpl_handler()
226 SNIC_HOST_INFO(snic->shost, "Exch_cmpl Done, hdr_stat %d.\n", hdr_stat); in snic_io_exch_ver_cmpl_handler()
237 snic_get_conf(struct snic *snic) in snic_get_conf() argument
244 SNIC_HOST_INFO(snic->shost, "Retrieving snic params.\n"); in snic_get_conf()
245 spin_lock_irqsave(&snic->snic_lock, flags); in snic_get_conf()
246 memset(&snic->fwinfo, 0, sizeof(snic->fwinfo)); in snic_get_conf()
247 snic->fwinfo.wait = &wait; in snic_get_conf()
248 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_get_conf()
258 ret = snic_queue_exch_ver_req(snic); in snic_get_conf()
263 spin_lock_irqsave(&snic->snic_lock, flags); in snic_get_conf()
264 ret = (snic->fwinfo.fw_ver != 0) ? 0 : -ETIMEDOUT; in snic_get_conf()
266 SNIC_HOST_ERR(snic->shost, in snic_get_conf()
271 snic->fwinfo.wait = NULL; in snic_get_conf()
273 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_get_conf()