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, "Init Exch Ver Req failed\n"); in snic_queue_exch_ver_req()
126 snic->config.hid, 0, (ulong)rqi); in snic_queue_exch_ver_req()
131 snic_handle_untagged_req(snic, rqi); in snic_queue_exch_ver_req()
133 ret = snic_queue_wq_desc(snic, req, sizeof(*req)); in snic_queue_exch_ver_req()
135 snic_release_untagged_req(snic, rqi); in snic_queue_exch_ver_req()
136 SNIC_HOST_ERR(snic->shost, in snic_queue_exch_ver_req()
142 SNIC_HOST_INFO(snic->shost, "Exch Ver Req is issued. ret = %d\n", ret); in snic_queue_exch_ver_req()
152 snic_io_exch_ver_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_io_exch_ver_cmpl_handler() argument
161 SNIC_HOST_INFO(snic->shost, "Exch Ver Compl Received.\n"); in snic_io_exch_ver_cmpl_handler()
163 SNIC_BUG_ON(snic->config.hid != hid); in snic_io_exch_ver_cmpl_handler()
167 SNIC_HOST_ERR(snic->shost, in snic_io_exch_ver_cmpl_handler()
174 spin_lock_irqsave(&snic->snic_lock, flags); in snic_io_exch_ver_cmpl_handler()
175 snic->fwinfo.fw_ver = le32_to_cpu(exv_cmpl->version); in snic_io_exch_ver_cmpl_handler()
176 snic->fwinfo.hid = le32_to_cpu(exv_cmpl->hid); in snic_io_exch_ver_cmpl_handler()
177 snic->fwinfo.max_concur_ios = le32_to_cpu(exv_cmpl->max_concur_ios); in snic_io_exch_ver_cmpl_handler()
178 snic->fwinfo.max_sgs_per_cmd = le32_to_cpu(exv_cmpl->max_sgs_per_cmd); in snic_io_exch_ver_cmpl_handler()
179 snic->fwinfo.max_io_sz = le32_to_cpu(exv_cmpl->max_io_sz); in snic_io_exch_ver_cmpl_handler()
180 snic->fwinfo.max_tgts = le32_to_cpu(exv_cmpl->max_tgts); in snic_io_exch_ver_cmpl_handler()
181 snic->fwinfo.io_tmo = le16_to_cpu(exv_cmpl->io_timeout); in snic_io_exch_ver_cmpl_handler()
183 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
185 snic->fwinfo.fw_ver, in snic_io_exch_ver_cmpl_handler()
186 snic->fwinfo.hid, in snic_io_exch_ver_cmpl_handler()
187 snic->fwinfo.max_concur_ios, in snic_io_exch_ver_cmpl_handler()
188 snic->fwinfo.max_sgs_per_cmd, in snic_io_exch_ver_cmpl_handler()
189 snic->fwinfo.max_io_sz, in snic_io_exch_ver_cmpl_handler()
190 snic->fwinfo.max_tgts, in snic_io_exch_ver_cmpl_handler()
191 snic->fwinfo.io_tmo); in snic_io_exch_ver_cmpl_handler()
193 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
198 max_sgs = snic->fwinfo.max_sgs_per_cmd; in snic_io_exch_ver_cmpl_handler()
200 snic->shost->sg_tablesize = max_sgs; in snic_io_exch_ver_cmpl_handler()
201 SNIC_HOST_INFO(snic->shost, "Max SGs set to %d\n", in snic_io_exch_ver_cmpl_handler()
202 snic->shost->sg_tablesize); in snic_io_exch_ver_cmpl_handler()
203 } else if (max_sgs > snic->shost->sg_tablesize) { in snic_io_exch_ver_cmpl_handler()
204 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
206 snic->config.xpt_type, max_sgs, in snic_io_exch_ver_cmpl_handler()
207 snic->shost->sg_tablesize); in snic_io_exch_ver_cmpl_handler()
210 if (snic->shost->can_queue > snic->fwinfo.max_concur_ios) in snic_io_exch_ver_cmpl_handler()
211 snic->shost->can_queue = snic->fwinfo.max_concur_ios; in snic_io_exch_ver_cmpl_handler()
213 snic->shost->max_sectors = snic->fwinfo.max_io_sz >> 9; in snic_io_exch_ver_cmpl_handler()
214 if (snic->fwinfo.wait) in snic_io_exch_ver_cmpl_handler()
215 complete(snic->fwinfo.wait); in snic_io_exch_ver_cmpl_handler()
217 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_io_exch_ver_cmpl_handler()
220 snic_release_untagged_req(snic, rqi); in snic_io_exch_ver_cmpl_handler()
222 SNIC_HOST_INFO(snic->shost, "Exch_cmpl Done, hdr_stat %d.\n", hdr_stat); in snic_io_exch_ver_cmpl_handler()
231 snic_get_conf(struct snic *snic) in snic_get_conf() argument
238 SNIC_HOST_INFO(snic->shost, "Retrieving snic params.\n"); in snic_get_conf()
239 spin_lock_irqsave(&snic->snic_lock, flags); in snic_get_conf()
240 memset(&snic->fwinfo, 0, sizeof(snic->fwinfo)); in snic_get_conf()
241 snic->fwinfo.wait = &wait; in snic_get_conf()
242 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_get_conf()
252 ret = snic_queue_exch_ver_req(snic); in snic_get_conf()
257 spin_lock_irqsave(&snic->snic_lock, flags); in snic_get_conf()
258 ret = (snic->fwinfo.fw_ver != 0) ? 0 : -ETIMEDOUT; in snic_get_conf()
260 SNIC_HOST_ERR(snic->shost, in snic_get_conf()
265 snic->fwinfo.wait = NULL; in snic_get_conf()
267 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_get_conf()