Lines Matching refs:sq

17 	struct nvmet_sq *sq = container_of(to_delayed_work(work),
21 __func__, sq->ctrl->cntlid, sq->qid, sq->dhchap_tid);
22 sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
23 sq->dhchap_tid = -1;
26 void nvmet_auth_sq_init(struct nvmet_sq *sq)
29 INIT_DELAYED_WORK(&sq->auth_expired_work, nvmet_auth_expired_work);
30 sq->authenticated = false;
31 sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
36 struct nvmet_ctrl *ctrl = req->sq->ctrl;
41 __func__, ctrl->cntlid, req->sq->qid,
45 req->sq->dhchap_tid = le16_to_cpu(data->t_id);
70 __func__, ctrl->cntlid, req->sq->qid);
74 __func__, ctrl->cntlid, req->sq->qid,
98 __func__, ctrl->cntlid, req->sq->qid);
102 __func__, ctrl->cntlid, req->sq->qid,
107 __func__, ctrl->cntlid, req->sq->qid,
114 struct nvmet_ctrl *ctrl = req->sq->ctrl;
120 __func__, ctrl->cntlid, req->sq->qid,
137 ctrl->cntlid, req->sq->qid);
143 ctrl->cntlid, req->sq->qid);
150 ctrl->cntlid, req->sq->qid);
156 __func__, ctrl->cntlid, req->sq->qid);
158 req->sq->dhchap_c2 = kmemdup(data->rval + data->hl, data->hl,
160 if (!req->sq->dhchap_c2)
164 __func__, ctrl->cntlid, req->sq->qid, data->hl,
165 req->sq->dhchap_c2);
167 req->sq->authenticated = true;
168 req->sq->dhchap_c2 = NULL;
170 req->sq->dhchap_s2 = le32_to_cpu(data->seqnum);
184 struct nvmet_ctrl *ctrl = req->sq->ctrl;
232 ctrl->cntlid, req->sq->qid, data->auth_type, data->auth_id,
233 req->sq->dhchap_step);
241 ctrl->cntlid, req->sq->qid);
242 if (!req->sq->qid) {
251 req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
252 } else if (data->auth_id != req->sq->dhchap_step)
257 req->sq->dhchap_step =
260 req->sq->dhchap_step =
262 req->sq->dhchap_status = status;
267 if (data->auth_id != req->sq->dhchap_step) {
269 __func__, ctrl->cntlid, req->sq->qid,
270 data->auth_id, req->sq->dhchap_step);
273 if (le16_to_cpu(data->t_id) != req->sq->dhchap_tid) {
275 __func__, ctrl->cntlid, req->sq->qid,
277 req->sq->dhchap_tid);
278 req->sq->dhchap_step =
280 req->sq->dhchap_status =
289 req->sq->dhchap_step =
292 req->sq->dhchap_step =
294 req->sq->dhchap_status = status;
299 req->sq->authenticated = true;
301 __func__, ctrl->cntlid, req->sq->qid);
307 ctrl->cntlid, req->sq->qid, status);
308 req->sq->dhchap_status = status;
309 req->sq->authenticated = false;
314 req->sq->dhchap_status =
316 req->sq->dhchap_step =
318 req->sq->authenticated = false;
322 req->sq->dhchap_status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_MESSAGE;
323 req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_FAILURE2;
329 ctrl->cntlid, req->sq->qid,
330 req->sq->dhchap_status, req->sq->dhchap_step);
333 __func__, ctrl->cntlid, req->sq->qid,
336 if (req->sq->dhchap_step != NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2 &&
337 req->sq->dhchap_step != NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) {
340 mod_delayed_work(system_wq, &req->sq->auth_expired_work,
345 nvmet_auth_sq_free(req->sq);
346 if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE2)
356 struct nvmet_ctrl *ctrl = req->sq->ctrl;
369 req->sq->dhchap_s1 = nvme_auth_get_seqnum();
372 data->t_id = cpu_to_le16(req->sq->dhchap_tid);
375 data->seqnum = cpu_to_le32(req->sq->dhchap_s1);
376 req->sq->dhchap_c1 = kmalloc(data->hl, GFP_KERNEL);
377 if (!req->sq->dhchap_c1)
379 get_random_bytes(req->sq->dhchap_c1, data->hl);
380 memcpy(data->cval, req->sq->dhchap_c1, data->hl);
388 __func__, ctrl->cntlid, req->sq->qid, req->sq->dhchap_s1,
389 req->sq->dhchap_tid, data->hl, ctrl->dh_keysize);
396 struct nvmet_ctrl *ctrl = req->sq->ctrl;
403 data->t_id = cpu_to_le16(req->sq->dhchap_tid);
405 if (req->sq->dhchap_c2) {
408 ctrl->cntlid, req->sq->qid);
415 ctrl->cntlid, req->sq->qid, data->hl, data->rval);
427 data->t_id = cpu_to_le16(req->sq->dhchap_tid);
429 data->rescode_exp = req->sq->dhchap_status;
434 struct nvmet_ctrl *ctrl = req->sq->ctrl;
475 ctrl->cntlid, req->sq->qid, req->sq->dhchap_step);
476 switch (req->sq->dhchap_step) {
480 ctrl->cntlid, req->sq->qid, status);
484 req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_REPLY;
489 req->sq->dhchap_status = status;
490 req->sq->authenticated = false;
493 ctrl->cntlid, req->sq->qid,
494 req->sq->dhchap_status);
497 req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2;
500 req->sq->authenticated = false;
503 ctrl->cntlid, req->sq->qid, req->sq->dhchap_status);
507 ctrl->cntlid, req->sq->qid, req->sq->dhchap_step);
508 req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_FAILURE1;
509 req->sq->dhchap_status = NVME_AUTH_DHCHAP_FAILURE_FAILED;
520 if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2)
521 nvmet_auth_sq_free(req->sq);
522 else if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) {
523 nvmet_auth_sq_free(req->sq);