|
Lines 683-703
Link Here
|
| 683 |
tw_osli_req_q_init(sc, TW_OSLI_FREE_Q); |
683 |
tw_osli_req_q_init(sc, TW_OSLI_FREE_Q); |
| 684 |
tw_osli_req_q_init(sc, TW_OSLI_BUSY_Q); |
684 |
tw_osli_req_q_init(sc, TW_OSLI_BUSY_Q); |
| 685 |
|
685 |
|
| 686 |
if ((sc->req_ctx_buf = (struct tw_osli_req_context *) |
686 |
sc->req_ctx_buf = (struct tw_osli_req_context *) |
| 687 |
malloc((sizeof(struct tw_osli_req_context) * |
687 |
malloc((sizeof(struct tw_osli_req_context) * TW_OSLI_MAX_NUM_REQUESTS), |
| 688 |
TW_OSLI_MAX_NUM_REQUESTS), |
688 |
TW_OSLI_MALLOC_CLASS, M_WAITOK | M_ZERO); |
| 689 |
TW_OSLI_MALLOC_CLASS, M_WAITOK)) == NULL) { |
|
|
| 690 |
tw_osli_printf(sc, "error = %d", |
| 691 |
TW_CL_SEVERITY_ERROR_STRING, |
| 692 |
TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, |
| 693 |
0x2012, |
| 694 |
"Failed to allocate request packets", |
| 695 |
ENOMEM); |
| 696 |
return(ENOMEM); |
| 697 |
} |
| 698 |
bzero(sc->req_ctx_buf, |
| 699 |
sizeof(struct tw_osli_req_context) * TW_OSLI_MAX_NUM_REQUESTS); |
| 700 |
|
| 701 |
for (i = 0; i < TW_OSLI_MAX_NUM_REQUESTS; i++) { |
689 |
for (i = 0; i < TW_OSLI_MAX_NUM_REQUESTS; i++) { |
| 702 |
req = &(sc->req_ctx_buf[i]); |
690 |
req = &(sc->req_ctx_buf[i]); |
| 703 |
req->ctlr = sc; |
691 |
req->ctlr = sc; |