MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ccp_find_lsb_regions

Function ccp_find_lsb_regions

dpdk/drivers/crypto/ccp/ccp_dev.c:339–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339static int
340ccp_find_lsb_regions(struct ccp_queue *cmd_q, uint64_t status)
341{
342 int q_mask = 1 << cmd_q->id;
343 int weight = 0;
344 int j;
345
346 /* Build a bit mask to know which LSBs
347 * this queue has access to.
348 * Don't bother with segment 0
349 * as it has special
350 * privileges.
351 */
352 cmd_q->lsbmask = 0;
353 status >>= LSB_REGION_WIDTH;
354 for (j = 1; j < MAX_LSB_CNT; j++) {
355 if (status & q_mask)
356 ccp_set_bit(&cmd_q->lsbmask, j);
357
358 status >>= LSB_REGION_WIDTH;
359 }
360
361 for (j = 0; j < MAX_LSB_CNT; j++)
362 if (ccp_get_bit(&cmd_q->lsbmask, j))
363 weight++;
364
365 CCP_LOG_DBG("Queue %d can access %d LSB regions of mask %lu",
366 (int)cmd_q->id, weight, cmd_q->lsbmask);
367
368 return weight ? 0 : -EINVAL;
369}
370
371static int
372ccp_find_and_assign_lsb_to_q(struct ccp_device *ccp,

Callers 1

ccp_add_deviceFunction · 0.85

Calls 2

ccp_set_bitFunction · 0.85
ccp_get_bitFunction · 0.85

Tested by

no test coverage detected