Lines Matching refs:status

236 #define STATUS_GET_ORB_HIGH(v)		((v).status & 0xffff)
237 #define STATUS_GET_SBP_STATUS(v) (((v).status >> 16) & 0xff)
238 #define STATUS_GET_LEN(v) (((v).status >> 24) & 0x07)
239 #define STATUS_GET_DEAD(v) (((v).status >> 27) & 0x01)
240 #define STATUS_GET_RESPONSE(v) (((v).status >> 28) & 0x03)
241 #define STATUS_GET_SOURCE(v) (((v).status >> 30) & 0x03)
246 u32 status;
261 void (*callback)(struct sbp2_orb * orb, struct sbp2_status * status);
288 struct sbp2_status status;
413 struct sbp2_status status;
417 length < 8 || length > sizeof(status)) {
422 status.status = be32_to_cpup(payload);
423 status.orb_low = be32_to_cpup(payload + 4);
424 memset(status.data, 0, sizeof(status.data));
426 memcpy(status.data, payload + 8, length - 8);
428 if (STATUS_GET_SOURCE(status) == 2 || STATUS_GET_SOURCE(status) == 3) {
430 "non-ORB related status write, not handled\n");
435 /* Lookup the orb corresponding to this status write. */
438 if (STATUS_GET_ORB_HIGH(status) == 0 &&
439 STATUS_GET_ORB_LOW(status) == iter->request_bus) {
449 orb->callback(orb, &status);
452 dev_err(lu_dev(lu), "status write for unknown ORB\n");
465 * This is a little tricky. We can get the status write for
466 * the orb before we get this callback. The status write
471 * failed and we didn't already get a status write.
539 struct sbp2_status *status)
544 if (status)
545 memcpy(&orb->status, status, sizeof(*status));
624 if (STATUS_GET_RESPONSE(orb->status) != 0 ||
625 STATUS_GET_SBP_STATUS(orb->status) != 0) {
626 dev_err(lu_dev(lu), "error status: %d:%d\n",
627 STATUS_GET_RESPONSE(orb->status),
628 STATUS_GET_SBP_STATUS(orb->status));
930 * We could check for "Function rejected" status, but
1337 struct sbp2_status *status)
1344 if (status != NULL) {
1345 if (STATUS_GET_DEAD(*status))
1348 switch (STATUS_GET_RESPONSE(*status)) {
1362 if (result == DID_OK << 16 && STATUS_GET_LEN(*status) > 1)
1363 result = sbp2_status_to_sense_data(STATUS_GET_DATA(*status),
1367 * If the orb completes with status == NULL, something