can: mcp251xfd: cleanups and preparation to improve FIFO handling
Subsystems (2)
Marc Kleine-Budde
maintainercover can: mcp251xfd: cleanups and preparation to improve FIFO handling
Hello,
this series consists of a lot of cleanups and preparation work to improve FIFO handling. The actual patches for improved FIFO handling will be posted later.
regards,
Marc
Marc Kleine-Budde
maintainerPATCH 1/13 can: mcp251xfd: remove double blank lines
This patch removes double blank lines from the driver.
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 1 - drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +0 -1
@@ -979,7 +979,6 @@ static u8 mcp251xfd_get_normal_mode(const struct mcp251xfd_priv *priv) {u8 mode; -if (priv->can.ctrlmode &CAN_CTRLMODE_LOOPBACK ) mode =MCP251XFD_REG_CON_MODE_INT_LOOPBACK ;else if (priv->can.ctrlmode &CAN_CTRLMODE_LISTENONLY )
drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c +0 -1
@@ -250,7 +250,6 @@ mcp251xfd_regmap_crc_read_check_crc(const struct mcp251xfd_map_buf_crc * const breturn 0 ; } -static int mcp251xfd_regmap_crc_read_one (struct mcp251xfd_priv *priv,struct spi_message *msg,unsigned int data_len)
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 2/13 can: mcp251xfd: mcp251xfd_tef_obj_read(): fix typo in error message
In reply to Marc Kleine-BuddeThis patch fixes a typo in the error message in mcp251xfd_tef_obj_read(), if trying to read too many objects.
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +1 -1
@@ -1335,7 +1335,7 @@ mcp251xfd_tef_obj_read(const struct mcp251xfd_priv *priv, len > tx_ring->obj_num || offset + len > tx_ring->obj_num)) {netdev_err (priv->ndev, -"Trying to read to many TEF objects (max=%d, offset=%d, len=%d).\n" , +"Trying to read too many TEF objects (max=%d, offset=%d, len=%d).\n" , tx_ring->obj_num, offset, len);return -ERANGE ; }
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 3/13 can: mcp251xfd: add missing newline to printed strings
In reply to Marc Kleine-BuddeThis patch adds the missing newline to printed strings.
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +2 -2
@@ -2624,7 +2624,7 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)if (!mcp251xfd_is_251X (priv) && priv->devtype_data.model != devtype_data->model) {netdev_info (ndev, -"Detected %s, but firmware specifies a %s. Fixing up." , +"Detected %s, but firmware specifies a %s. Fixing up.\n" ,__mcp251xfd_get_model_str (devtype_data->model),mcp251xfd_get_model_str (priv)); }
@@ -2661,7 +2661,7 @@ static int mcp251xfd_register_check_rx_int(struct mcp251xfd_priv *priv)return 0 ;netdev_info (priv->ndev, -"RX_INT active after softreset, disabling RX_INT support." ); +"RX_INT active after softreset, disabling RX_INT support.\n" );devm_gpiod_put (&priv->spi->dev, priv->rx_int); priv->rx_int =NULL ;
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 4/13 can: mcp251xfd: mcp251xfd_open(): open_candev() first
In reply to Marc Kleine-BuddeThis patch exchanges the order of open_candev() and pm_runtime_get_sync(), so that open_candev() is called first.
A usual reason why open_candev() fails is missing CAN bit rate configuration. It makes no sense to resume the device from PM sleep first just to put it to sleep if the bit rate is not configured.
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +8 -8
@@ -2503,19 +2503,19 @@ static int mcp251xfd_open(struct net_device *ndev)const struct spi_device *spi = priv->spi;int err; + err =open_candev (ndev); +if (err) +return err; + err =pm_runtime_get_sync (ndev->dev.parent);if (err <0 ) {pm_runtime_put_noidle (ndev->dev.parent); -return err; + goto out_close_candev; } - err =open_candev (ndev); -if (err) - goto out_pm_runtime_put; - err =mcp251xfd_ring_alloc (priv);if (err) - goto out_close_candev; + goto out_pm_runtime_put; err =mcp251xfd_transceiver_enable (priv);if (err)
@@ -2551,11 +2551,11 @@ static int mcp251xfd_open(struct net_device *ndev)mcp251xfd_transceiver_disable (priv); out_mcp251xfd_ring_free:mcp251xfd_ring_free (priv); - out_close_candev: -close_candev (ndev); out_pm_runtime_put:mcp251xfd_chip_stop (priv,CAN_STATE_STOPPED );pm_runtime_put (ndev->dev.parent); + out_close_candev: +close_candev (ndev);return err; }
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 5/13 can: mcp251xfd: mcp251xfd_open(): make use of pm_runtime_resume_and_get()
In reply to Marc Kleine-BuddeWith patch
| dd8088d5a896 PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter
the usual pm_runtime_get_sync() and pm_runtime_put_noidle() in-case-of-error dance is no longer needed. Convert the mcp251xfd driver to use this function.
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +2 -4
@@ -2507,11 +2507,9 @@ static int mcp251xfd_open(struct net_device *ndev)if (err)return err; - err =pm_runtime_get_sync (ndev->dev.parent); -if (err <0 ) { -pm_runtime_put_noidle (ndev->dev.parent); + err =pm_runtime_resume_and_get (ndev->dev.parent); +if (err) goto out_close_candev; - } err =mcp251xfd_ring_alloc (priv);if (err)
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 6/13 can: mcp251xfd: mcp251xfd_handle_rxovif(): denote RX overflow message to debug + add rate limiting
In reply to Marc Kleine-BuddeA RX overflow usually happens during high system load. Printing overflow messages to the kernel log, which on embedded systems often is outputted on the serial console, even increases the system load.
To decrease the system load in these situations, denote the messages to debug level and wrap them with net_ratelimit().
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +8 -5
@@ -1652,12 +1652,15 @@ static int mcp251xfd_handle_rxovif(struct mcp251xfd_priv *priv)/* If SERRIF is active, there was a RX MAB overflow. */ if (priv->regs_status.intf &MCP251XFD_REG_INT_SERRIF ) { -netdev_info (priv->ndev, -"RX-%d: MAB overflow detected.\n" , - ring->nr); +if (net_ratelimit ()) +netdev_dbg (priv->ndev, +"RX-%d: MAB overflow detected.\n" , + ring->nr); }else { -netdev_info (priv->ndev, -"RX-%d: FIFO overflow.\n" , ring->nr); +if (net_ratelimit ()) +netdev_dbg (priv->ndev, +"RX-%d: FIFO overflow.\n" , + ring->nr); } err = regmap_update_bits(priv->map_reg,
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 7/13 can: mcp251xfd: mcp251xfd.h: sort function prototypes
In reply to Marc Kleine-BuddeThe .c files in the Makefile are ordered alphabetically. This patch groups the function prototypes by their corresponding .c file and brings the into the same order.
--- drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +1 -1
@@ -849,10 +849,10 @@ mcp251xfd_get_rx_linear_len(const struct mcp251xfd_rx_ring *ring) (n) < (priv)->rx_ring_num; \ (n)++, (ring) = *((priv)->rx + (n))) -int mcp251xfd_regmap_init (struct mcp251xfd_priv *priv);u16 mcp251xfd_crc16_compute2 (const void *cmd,size_t cmd_size,const void *data,size_t data_size);u16 mcp251xfd_crc16_compute (const void *data,size_t data_size); +int mcp251xfd_regmap_init (struct mcp251xfd_priv *priv);void mcp251xfd_skb_set_timestamp (const struct mcp251xfd_priv *priv,struct sk_buff *skb,u32 timestamp);void mcp251xfd_timestamp_init (struct mcp251xfd_priv *priv);
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 8/13 can: mcp251xfd: move RX handling into separate file
In reply to Marc Kleine-BuddeThis patch moves the RX handling from the mcp251xfd core file into a separate one to make the driver a bit more orderly.
--- drivers/net/can/spi/mcp251xfd/Makefile | 1 + .../net/can/spi/mcp251xfd/mcp251xfd-core.c | 244 ---------------- drivers/net/can/spi/mcp251xfd/mcp251xfd-rx.c | 260 ++++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 1 + 4 files changed, 262 insertions(+), 244 deletions(-) create mode 100644 drivers/net/can/spi/mcp251xfd/mcp251xfd-rx.c
drivers/net/can/spi/mcp251xfd/Makefile +1 -0
@@ -6,6 +6,7 @@ mcp251xfd-objs := mcp251xfd-objs += mcp251xfd-core.o mcp251xfd-objs += mcp251xfd-crc16.o mcp251xfd-objs += mcp251xfd-regmap.o +mcp251xfd-objs += mcp251xfd-rx.o mcp251xfd-objs += mcp251xfd-timestamp.o mcp251xfd-$(CONFIG_DEV_COREDUMP) += mcp251xfd-dump.o
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +0 -244
262 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd-rx.c new file +260 -0
260 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +1 -0
@@ -853,6 +853,7 @@ u16 mcp251xfd_crc16_compute2(const void *cmd, size_t cmd_size, const void *data, size_t data_size);u16 mcp251xfd_crc16_compute (const void *data,size_t data_size);int mcp251xfd_regmap_init (struct mcp251xfd_priv *priv); +int mcp251xfd_handle_rxif (struct mcp251xfd_priv *priv);void mcp251xfd_skb_set_timestamp (const struct mcp251xfd_priv *priv,struct sk_buff *skb,u32 timestamp);void mcp251xfd_timestamp_init (struct mcp251xfd_priv *priv);
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 9/13 can: mcp251xfd: move TX handling into separate file
In reply to Marc Kleine-BuddeThis patch moves the TX handling from the mcp251xfd core file into a separate one to make the driver a bit more orderly.
--- drivers/net/can/spi/mcp251xfd/Makefile | 1 + .../net/can/spi/mcp251xfd/mcp251xfd-core.c | 187 ---------------- drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c | 205 ++++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 3 + 4 files changed, 209 insertions(+), 187 deletions(-) create mode 100644 drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c
drivers/net/can/spi/mcp251xfd/Makefile +1 -0
@@ -8,5 +8,6 @@ mcp251xfd-objs += mcp251xfd-crc16.o mcp251xfd-objs += mcp251xfd-regmap.o mcp251xfd-objs += mcp251xfd-rx.o mcp251xfd-objs += mcp251xfd-timestamp.o +mcp251xfd-objs += mcp251xfd-tx.o mcp251xfd-$(CONFIG_DEV_COREDUMP) += mcp251xfd-dump.o
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +0 -187
193 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c new file +205 -0
205 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +3 -0
@@ -859,6 +859,9 @@ void mcp251xfd_skb_set_timestamp(const struct mcp251xfd_priv *priv,void mcp251xfd_timestamp_init (struct mcp251xfd_priv *priv);void mcp251xfd_timestamp_stop (struct mcp251xfd_priv *priv); +netdev_tx_t mcp251xfd_start_xmit (struct sk_buff *skb, +struct net_device *ndev); +#if IS_ENABLED (CONFIG_DEV_COREDUMP )void mcp251xfd_dump (const struct mcp251xfd_priv *priv);#else
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 10/13 can: mcp251xfd: move TEF handling into separate file
In reply to Marc Kleine-BuddeThis patch moves the TEF handling from the mcp251xfd core file into a separate one to make the driver a bit more orderly.
--- drivers/net/can/spi/mcp251xfd/Makefile | 1 + .../net/can/spi/mcp251xfd/mcp251xfd-core.c | 261 ------------------ drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c | 260 +++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 20 ++ 4 files changed, 281 insertions(+), 261 deletions(-) create mode 100644 drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
drivers/net/can/spi/mcp251xfd/Makefile +1 -0
@@ -7,6 +7,7 @@ mcp251xfd-objs += mcp251xfd-core.o mcp251xfd-objs += mcp251xfd-crc16.o mcp251xfd-objs += mcp251xfd-regmap.o mcp251xfd-objs += mcp251xfd-rx.o +mcp251xfd-objs += mcp251xfd-tef.o mcp251xfd-objs += mcp251xfd-timestamp.o mcp251xfd-objs += mcp251xfd-tx.o
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +0 -261
279 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c new file +260 -0
260 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +20 -0
@@ -10,6 +10,7 @@#ifndef _MCP251XFD_H#define _MCP251XFD_H +#include <linux/bitfield.h> #include <linux/can/core.h> #include <linux/can/dev.h> #include <linux/can/rx-offload.h>
@@ -761,6 +762,24 @@ mcp251xfd_get_rx_obj_addr(const struct mcp251xfd_rx_ring *ring, u8 n)return ring->base + ring->obj_size * n; } +static inline int +mcp251xfd_tx_tail_get_from_chip (const struct mcp251xfd_priv *priv, +u8 *tx_tail) +{ +u32 fifo_sta; +int err; + + err =regmap_read (priv->map_reg, +MCP251XFD_REG_FIFOSTA (MCP251XFD_TX_FIFO ), + &fifo_sta); +if (err) +return err; + + *tx_tail =FIELD_GET (MCP251XFD_REG_FIFOSTA_FIFOCI_MASK , fifo_sta); + +return 0 ; +} +static inline u8 mcp251xfd_get_tef_head (const struct mcp251xfd_priv *priv) {return priv->tef->head & (priv->tx->obj_num -1 );
@@ -854,6 +873,7 @@ u16 mcp251xfd_crc16_compute2(const void *cmd, size_t cmd_size,u16 mcp251xfd_crc16_compute (const void *data,size_t data_size);int mcp251xfd_regmap_init (struct mcp251xfd_priv *priv);int mcp251xfd_handle_rxif (struct mcp251xfd_priv *priv); +int mcp251xfd_handle_tefif (struct mcp251xfd_priv *priv);void mcp251xfd_skb_set_timestamp (const struct mcp251xfd_priv *priv,struct sk_buff *skb,u32 timestamp);void mcp251xfd_timestamp_init (struct mcp251xfd_priv *priv);
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 11/13 can: mcp251xfd: move chip FIFO init into separate file
In reply to Marc Kleine-BuddeThis patch moves the chip FIFO initialization from the mcp251xfd core file into a separate one to make the driver a bit more orderly.
--- drivers/net/can/spi/mcp251xfd/Makefile | 1 + .../can/spi/mcp251xfd/mcp251xfd-chip-fifo.c | 119 ++++++++++++++++++ .../net/can/spi/mcp251xfd/mcp251xfd-core.c | 102 --------------- drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 1 + 4 files changed, 121 insertions(+), 102 deletions(-) create mode 100644 drivers/net/can/spi/mcp251xfd/mcp251xfd-chip-fifo.c
drivers/net/can/spi/mcp251xfd/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_CAN_MCP251XFD) += mcp251xfd.o mcp251xfd-objs := +mcp251xfd-objs += mcp251xfd-chip-fifo.o mcp251xfd-objs += mcp251xfd-core.o mcp251xfd-objs += mcp251xfd-crc16.o mcp251xfd-objs += mcp251xfd-regmap.o
drivers/net/can/spi/mcp251xfd/mcp251xfd-chip-fifo.c new file +119 -0
119 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +0 -102
108 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +1 -0
@@ -868,6 +868,7 @@ mcp251xfd_get_rx_linear_len(const struct mcp251xfd_rx_ring *ring) (n) < (priv)->rx_ring_num; \ (n)++, (ring) = *((priv)->rx + (n))) +int mcp251xfd_chip_fifo_init (const struct mcp251xfd_priv *priv);u16 mcp251xfd_crc16_compute2 (const void *cmd,size_t cmd_size,const void *data,size_t data_size);u16 mcp251xfd_crc16_compute (const void *data,size_t data_size);
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 12/13 can: mcp251xfd: move ring init into separate function
In reply to Marc Kleine-BuddeThis patch moves the ring initialization from the mcp251xfd core file into a separate one to make the driver a bit more orderly.
--- drivers/net/can/spi/mcp251xfd/Makefile | 1 + .../net/can/spi/mcp251xfd/mcp251xfd-core.c | 255 ----------------- .../net/can/spi/mcp251xfd/mcp251xfd-ring.c | 270 ++++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 3 + 4 files changed, 274 insertions(+), 255 deletions(-) create mode 100644 drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
drivers/net/can/spi/mcp251xfd/Makefile +1 -0
@@ -7,6 +7,7 @@ mcp251xfd-objs += mcp251xfd-chip-fifo.o mcp251xfd-objs += mcp251xfd-core.o mcp251xfd-objs += mcp251xfd-crc16.o mcp251xfd-objs += mcp251xfd-regmap.o +mcp251xfd-objs += mcp251xfd-ring.o mcp251xfd-objs += mcp251xfd-rx.o mcp251xfd-objs += mcp251xfd-tef.o mcp251xfd-objs += mcp251xfd-timestamp.o
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +0 -255
267 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c new file +270 -0
270 lines not on this page · raw message
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +3 -0
@@ -873,6 +873,9 @@ u16 mcp251xfd_crc16_compute2(const void *cmd, size_t cmd_size, const void *data, size_t data_size);u16 mcp251xfd_crc16_compute (const void *data,size_t data_size);int mcp251xfd_regmap_init (struct mcp251xfd_priv *priv); +void mcp251xfd_ring_init (struct mcp251xfd_priv *priv); +void mcp251xfd_ring_free (struct mcp251xfd_priv *priv); +int mcp251xfd_ring_alloc (struct mcp251xfd_priv *priv);int mcp251xfd_handle_rxif (struct mcp251xfd_priv *priv);int mcp251xfd_handle_tefif (struct mcp251xfd_priv *priv); void mcp251xfd_skb_set_timestamp(const struct mcp251xfd_priv *priv,
Signature · 1 line
2.34.1
Marc Kleine-Budde
maintainerPATCH 13/13 can: mcp251xfd: introduce and make use of mcp251xfd_is_fd_mode()
In reply to Marc Kleine-BuddeThis patch replaces the open coded check, if the chip's FIFOs are configured for CAN-FD mode, by the newly introduced function mcp251xfd_is_fd_mode().
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-chip-fifo.c | 4 ++-- drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 3 +-- drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 6 ++++++ 3 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-chip-fifo.c +2 -2
@@ -34,7 +34,7 @@ mcp251xfd_chip_rx_fifo_init_one(const struct mcp251xfd_priv *priv,MCP251XFD_REG_FIFOCON_RXOVIE |MCP251XFD_REG_FIFOCON_TFNRFNIE ; -if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY |CAN_CTRLMODE_FD )) +if (mcp251xfd_is_fd_mode (priv)) fifo_con |=FIELD_PREP (MCP251XFD_REG_FIFOCON_PLSIZE_MASK ,MCP251XFD_REG_FIFOCON_PLSIZE_64 );else
@@ -84,7 +84,7 @@ int mcp251xfd_chip_fifo_init(const struct mcp251xfd_priv *priv)MCP251XFD_REG_FIFOCON_TXEN |MCP251XFD_REG_FIFOCON_TXATIE ; -if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY |CAN_CTRLMODE_FD )) +if (mcp251xfd_is_fd_mode (priv)) val |=FIELD_PREP (MCP251XFD_REG_FIFOCON_PLSIZE_MASK ,MCP251XFD_REG_FIFOCON_PLSIZE_64 );else
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c +1 -2
@@ -209,8 +209,7 @@ int mcp251xfd_ring_alloc(struct mcp251xfd_priv *priv)int ram_free, i; tef_obj_size =sizeof (struct mcp251xfd_hw_tef_obj ); -/* listen-only mode works like FD mode */ -if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY |CAN_CTRLMODE_FD )) { +if (mcp251xfd_is_fd_mode (priv)) { tx_obj_num =MCP251XFD_TX_OBJ_NUM_CANFD ; tx_obj_size =sizeof (struct mcp251xfd_hw_tx_obj_canfd ); rx_obj_size =sizeof (struct mcp251xfd_hw_rx_obj_canfd );
drivers/net/can/spi/mcp251xfd/mcp251xfd.h +6 -0
@@ -626,6 +626,12 @@ MCP251XFD_IS(2517);MCP251XFD_IS (2518 ); MCP251XFD_IS(251X); +static inline bool mcp251xfd_is_fd_mode (const struct mcp251xfd_priv *priv) +{ +/* listen-only mode works like FD mode */ +return priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY |CAN_CTRLMODE_FD ); +} +static inline u8 mcp251xfd_first_byte_set (u32 mask) { return (mask & 0x0000ffff) ?
Signature · 1 line
2.34.1