struct rx_pkt_cmpl *rx_cmp,
struct rx_pkt_cmpl_hi *rx_cmp_hi )
{
- u32 desc_idx = rx_cmp->opaque;
+ u32 desc_idx = rx_cmp->opaque & ( NUM_RX_BUFFERS - 1 );
struct io_buffer *iob = bp->rx.iob[desc_idx];
u8 drop;
for ( idx = 0; idx < wait_cnt; idx++ ) {
resp_len = resp->resp_len;
- if ( resp->seq_id == req->seq_id &&
- resp->req_type == req->req_type &&
- ptr[resp_len - 1] == 1 ) {
- bp->last_resp_code = resp->error_code;
- ret = resp->error_code;
- break;
+
+ if ( resp_len != 0 && resp_len <= ( u16 ) RESP_BUFFER_SIZE ) {
+ if ( resp->seq_id == req->seq_id &&
+ resp->req_type == req->req_type &&
+ ptr[resp_len - 1] == 1 ) {
+ bp->last_resp_code = resp->error_code;
+ ret = resp->error_code;
+ break;
+ }
}
udelay ( HWRM_CMD_POLL_WAIT_TIME );
}