| .. | .. |
|---|
| 435 | 435 | |
|---|
| 436 | 436 | struct fman_port_rx_pools_params { |
|---|
| 437 | 437 | u8 num_of_pools; |
|---|
| 438 | | - u16 second_largest_buf_size; |
|---|
| 439 | 438 | u16 largest_buf_size; |
|---|
| 440 | 439 | }; |
|---|
| 441 | 440 | |
|---|
| .. | .. |
|---|
| 946 | 945 | port->rx_pools_params.num_of_pools = ext_buf_pools->num_of_pools_used; |
|---|
| 947 | 946 | port->rx_pools_params.largest_buf_size = |
|---|
| 948 | 947 | sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 1]]; |
|---|
| 949 | | - port->rx_pools_params.second_largest_buf_size = |
|---|
| 950 | | - sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 2]]; |
|---|
| 951 | 948 | |
|---|
| 952 | 949 | /* FMBM_RMPD reg. - pool depletion */ |
|---|
| 953 | 950 | if (buf_pool_depletion->pools_grp_mode_enable) { |
|---|
| .. | .. |
|---|
| 1347 | 1344 | switch (port->port_type) { |
|---|
| 1348 | 1345 | case FMAN_PORT_TYPE_RX: |
|---|
| 1349 | 1346 | set_rx_dflt_cfg(port, params); |
|---|
| 1350 | | - /* fall through */ |
|---|
| 1347 | + fallthrough; |
|---|
| 1351 | 1348 | case FMAN_PORT_TYPE_TX: |
|---|
| 1352 | 1349 | set_tx_dflt_cfg(port, params, &port->dts_params); |
|---|
| 1353 | | - /* fall through */ |
|---|
| 1350 | + fallthrough; |
|---|
| 1354 | 1351 | default: |
|---|
| 1355 | 1352 | set_dflt_cfg(port, params); |
|---|
| 1356 | 1353 | } |
|---|
| .. | .. |
|---|
| 1413 | 1410 | } |
|---|
| 1414 | 1411 | EXPORT_SYMBOL(fman_port_config); |
|---|
| 1415 | 1412 | |
|---|
| 1416 | | -/** |
|---|
| 1413 | +/* |
|---|
| 1417 | 1414 | * fman_port_use_kg_hash |
|---|
| 1418 | | - * port: A pointer to a FM Port module. |
|---|
| 1415 | + * @port: A pointer to a FM Port module. |
|---|
| 1416 | + * @enable: enable or disable |
|---|
| 1417 | + * |
|---|
| 1419 | 1418 | * Sets the HW KeyGen or the BMI as HW Parser next engine, enabling |
|---|
| 1420 | 1419 | * or bypassing the KeyGen hashing of Rx traffic |
|---|
| 1421 | 1420 | */ |
|---|
| .. | .. |
|---|
| 1433 | 1432 | |
|---|
| 1434 | 1433 | /** |
|---|
| 1435 | 1434 | * fman_port_init |
|---|
| 1436 | | - * port: A pointer to a FM Port module. |
|---|
| 1435 | + * @port: A pointer to a FM Port module. |
|---|
| 1436 | + * |
|---|
| 1437 | 1437 | * Initializes the FM PORT module by defining the software structure and |
|---|
| 1438 | 1438 | * configuring the hardware registers. |
|---|
| 1439 | 1439 | * |
|---|
| .. | .. |
|---|
| 1527 | 1527 | |
|---|
| 1528 | 1528 | /** |
|---|
| 1529 | 1529 | * fman_port_cfg_buf_prefix_content |
|---|
| 1530 | | - * @port A pointer to a FM Port module. |
|---|
| 1531 | | - * @buffer_prefix_content A structure of parameters describing |
|---|
| 1530 | + * @port: A pointer to a FM Port module. |
|---|
| 1531 | + * @buffer_prefix_content: A structure of parameters describing |
|---|
| 1532 | 1532 | * the structure of the buffer. |
|---|
| 1533 | 1533 | * Out parameter: |
|---|
| 1534 | 1534 | * Start margin - offset of data from |
|---|
| .. | .. |
|---|
| 1573 | 1573 | |
|---|
| 1574 | 1574 | /** |
|---|
| 1575 | 1575 | * fman_port_disable |
|---|
| 1576 | | - * port: A pointer to a FM Port module. |
|---|
| 1576 | + * @port: A pointer to a FM Port module. |
|---|
| 1577 | 1577 | * |
|---|
| 1578 | 1578 | * Gracefully disable an FM port. The port will not start new tasks after all |
|---|
| 1579 | 1579 | * tasks associated with the port are terminated. |
|---|
| .. | .. |
|---|
| 1654 | 1654 | |
|---|
| 1655 | 1655 | /** |
|---|
| 1656 | 1656 | * fman_port_enable |
|---|
| 1657 | | - * port: A pointer to a FM Port module. |
|---|
| 1657 | + * @port: A pointer to a FM Port module. |
|---|
| 1658 | 1658 | * |
|---|
| 1659 | 1659 | * A runtime routine provided to allow disable/enable of port. |
|---|
| 1660 | 1660 | * |
|---|
| .. | .. |
|---|
| 1700 | 1700 | |
|---|
| 1701 | 1701 | /** |
|---|
| 1702 | 1702 | * fman_port_bind |
|---|
| 1703 | | - * dev: FMan Port OF device pointer |
|---|
| 1703 | + * @dev: FMan Port OF device pointer |
|---|
| 1704 | 1704 | * |
|---|
| 1705 | 1705 | * Bind to a specific FMan Port. |
|---|
| 1706 | 1706 | * |
|---|
| .. | .. |
|---|
| 1716 | 1716 | |
|---|
| 1717 | 1717 | /** |
|---|
| 1718 | 1718 | * fman_port_get_qman_channel_id |
|---|
| 1719 | | - * port: Pointer to the FMan port devuce |
|---|
| 1719 | + * @port: Pointer to the FMan port devuce |
|---|
| 1720 | 1720 | * |
|---|
| 1721 | 1721 | * Get the QMan channel ID for the specific port |
|---|
| 1722 | 1722 | * |
|---|
| .. | .. |
|---|
| 1728 | 1728 | } |
|---|
| 1729 | 1729 | EXPORT_SYMBOL(fman_port_get_qman_channel_id); |
|---|
| 1730 | 1730 | |
|---|
| 1731 | +/** |
|---|
| 1732 | + * fman_port_get_device |
|---|
| 1733 | + * @port: Pointer to the FMan port device |
|---|
| 1734 | + * |
|---|
| 1735 | + * Get the 'struct device' associated to the specified FMan port device |
|---|
| 1736 | + * |
|---|
| 1737 | + * Return: pointer to associated 'struct device' |
|---|
| 1738 | + */ |
|---|
| 1739 | +struct device *fman_port_get_device(struct fman_port *port) |
|---|
| 1740 | +{ |
|---|
| 1741 | + return port->dev; |
|---|
| 1742 | +} |
|---|
| 1743 | +EXPORT_SYMBOL(fman_port_get_device); |
|---|
| 1744 | + |
|---|
| 1731 | 1745 | int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset) |
|---|
| 1732 | 1746 | { |
|---|
| 1733 | 1747 | if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE) |
|---|