Lines Matching refs:snic

26 	struct snic *snic = container_of(work, struct snic, link_work);  in snic_handle_link()  local
28 if (snic->config.xpt_type == SNIC_DAS) in snic_handle_link()
31 snic->link_status = svnic_dev_link_status(snic->vdev); in snic_handle_link()
32 snic->link_down_cnt = svnic_dev_link_down_cnt(snic->vdev); in snic_handle_link()
33 SNIC_HOST_INFO(snic->shost, "Link Event: Link %s.\n", in snic_handle_link()
34 ((snic->link_status) ? "Up" : "Down")); in snic_handle_link()
92 snic_queue_exch_ver_req(struct snic *snic) in snic_queue_exch_ver_req() argument
99 SNIC_HOST_INFO(snic->shost, "Exch Ver Req Preparing...\n"); in snic_queue_exch_ver_req()
101 rqi = snic_req_init(snic, 0); in snic_queue_exch_ver_req()
103 SNIC_HOST_ERR(snic->shost, "Init Exch Ver Req failed\n"); in snic_queue_exch_ver_req()
112 snic->config.hid, 0, (ulong)rqi); in snic_queue_exch_ver_req()
117 snic_handle_untagged_req(snic, rqi); in snic_queue_exch_ver_req()
119 ret = snic_queue_wq_desc(snic, req, sizeof(*req)); in snic_queue_exch_ver_req()
121 snic_release_untagged_req(snic, rqi); in snic_queue_exch_ver_req()
122 SNIC_HOST_ERR(snic->shost, in snic_queue_exch_ver_req()
128 SNIC_HOST_INFO(snic->shost, "Exch Ver Req is issued. ret = %d\n", ret); in snic_queue_exch_ver_req()
138 snic_io_exch_ver_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_io_exch_ver_cmpl_handler() argument
147 SNIC_HOST_INFO(snic->shost, "Exch Ver Compl Received.\n"); in snic_io_exch_ver_cmpl_handler()
149 SNIC_BUG_ON(snic->config.hid != hid); in snic_io_exch_ver_cmpl_handler()
153 SNIC_HOST_ERR(snic->shost, in snic_io_exch_ver_cmpl_handler()
160 spin_lock_irqsave(&snic->snic_lock, flags); in snic_io_exch_ver_cmpl_handler()
161 snic->fwinfo.fw_ver = le32_to_cpu(exv_cmpl->version); in snic_io_exch_ver_cmpl_handler()
162 snic->fwinfo.hid = le32_to_cpu(exv_cmpl->hid); in snic_io_exch_ver_cmpl_handler()
163 snic->fwinfo.max_concur_ios = le32_to_cpu(exv_cmpl->max_concur_ios); in snic_io_exch_ver_cmpl_handler()
164 snic->fwinfo.max_sgs_per_cmd = le32_to_cpu(exv_cmpl->max_sgs_per_cmd); in snic_io_exch_ver_cmpl_handler()
165 snic->fwinfo.max_io_sz = le32_to_cpu(exv_cmpl->max_io_sz); in snic_io_exch_ver_cmpl_handler()
166 snic->fwinfo.max_tgts = le32_to_cpu(exv_cmpl->max_tgts); in snic_io_exch_ver_cmpl_handler()
167 snic->fwinfo.io_tmo = le16_to_cpu(exv_cmpl->io_timeout); in snic_io_exch_ver_cmpl_handler()
169 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
171 snic->fwinfo.fw_ver, in snic_io_exch_ver_cmpl_handler()
172 snic->fwinfo.hid, in snic_io_exch_ver_cmpl_handler()
173 snic->fwinfo.max_concur_ios, in snic_io_exch_ver_cmpl_handler()
174 snic->fwinfo.max_sgs_per_cmd, in snic_io_exch_ver_cmpl_handler()
175 snic->fwinfo.max_io_sz, in snic_io_exch_ver_cmpl_handler()
176 snic->fwinfo.max_tgts, in snic_io_exch_ver_cmpl_handler()
177 snic->fwinfo.io_tmo); in snic_io_exch_ver_cmpl_handler()
179 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
184 max_sgs = snic->fwinfo.max_sgs_per_cmd; in snic_io_exch_ver_cmpl_handler()
186 snic->shost->sg_tablesize = max_sgs; in snic_io_exch_ver_cmpl_handler()
187 SNIC_HOST_INFO(snic->shost, "Max SGs set to %d\n", in snic_io_exch_ver_cmpl_handler()
188 snic->shost->sg_tablesize); in snic_io_exch_ver_cmpl_handler()
189 } else if (max_sgs > snic->shost->sg_tablesize) { in snic_io_exch_ver_cmpl_handler()
190 SNIC_HOST_INFO(snic->shost, in snic_io_exch_ver_cmpl_handler()
192 snic->config.xpt_type, max_sgs, in snic_io_exch_ver_cmpl_handler()
193 snic->shost->sg_tablesize); in snic_io_exch_ver_cmpl_handler()
196 if (snic->shost->can_queue > snic->fwinfo.max_concur_ios) in snic_io_exch_ver_cmpl_handler()
197 snic->shost->can_queue = snic->fwinfo.max_concur_ios; in snic_io_exch_ver_cmpl_handler()
199 snic->shost->max_sectors = snic->fwinfo.max_io_sz >> 9; in snic_io_exch_ver_cmpl_handler()
200 if (snic->fwinfo.wait) in snic_io_exch_ver_cmpl_handler()
201 complete(snic->fwinfo.wait); in snic_io_exch_ver_cmpl_handler()
203 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_io_exch_ver_cmpl_handler()
206 snic_release_untagged_req(snic, rqi); in snic_io_exch_ver_cmpl_handler()
208 SNIC_HOST_INFO(snic->shost, "Exch_cmpl Done, hdr_stat %d.\n", hdr_stat); in snic_io_exch_ver_cmpl_handler()
217 snic_get_conf(struct snic *snic) in snic_get_conf() argument
224 SNIC_HOST_INFO(snic->shost, "Retrieving snic params.\n"); in snic_get_conf()
225 spin_lock_irqsave(&snic->snic_lock, flags); in snic_get_conf()
226 memset(&snic->fwinfo, 0, sizeof(snic->fwinfo)); in snic_get_conf()
227 snic->fwinfo.wait = &wait; in snic_get_conf()
228 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_get_conf()
238 ret = snic_queue_exch_ver_req(snic); in snic_get_conf()
243 spin_lock_irqsave(&snic->snic_lock, flags); in snic_get_conf()
244 ret = (snic->fwinfo.fw_ver != 0) ? 0 : -ETIMEDOUT; in snic_get_conf()
246 SNIC_HOST_ERR(snic->shost, in snic_get_conf()
251 snic->fwinfo.wait = NULL; in snic_get_conf()
253 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_get_conf()