Lines Matching refs:buf_tx

30 	struct mcp251xfd_map_buf_nocrc *buf_tx = priv->map_buf_nocrc_tx;  in mcp251xfd_regmap_nocrc_gather_write()  local
33 .tx_buf = buf_tx, in mcp251xfd_regmap_nocrc_gather_write()
34 .len = sizeof(buf_tx->cmd) + val_len, in mcp251xfd_regmap_nocrc_gather_write()
38 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16)); in mcp251xfd_regmap_nocrc_gather_write()
41 reg_len != sizeof(buf_tx->cmd.cmd)) in mcp251xfd_regmap_nocrc_gather_write()
44 memcpy(&buf_tx->cmd, reg, sizeof(buf_tx->cmd)); in mcp251xfd_regmap_nocrc_gather_write()
45 memcpy(buf_tx->data, val, val_len); in mcp251xfd_regmap_nocrc_gather_write()
79 struct mcp251xfd_map_buf_nocrc *buf_tx = priv->map_buf_nocrc_tx; in mcp251xfd_regmap_nocrc_update_bits() local
85 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16)); in mcp251xfd_regmap_nocrc_update_bits()
103 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_nocrc_update_bits()
104 xfer[0].len = sizeof(buf_tx->cmd); in mcp251xfd_regmap_nocrc_update_bits()
110 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_nocrc_update_bits()
112 xfer[0].len = sizeof(buf_tx->cmd) + len; in mcp251xfd_regmap_nocrc_update_bits()
115 memset(buf_tx->data, 0x0, len); in mcp251xfd_regmap_nocrc_update_bits()
118 mcp251xfd_spi_cmd_read_nocrc(&buf_tx->cmd, reg + first_byte); in mcp251xfd_regmap_nocrc_update_bits()
132 mcp251xfd_spi_cmd_write_nocrc(&buf_tx->cmd, reg + first_byte); in mcp251xfd_regmap_nocrc_update_bits()
133 memcpy(buf_tx->data, &tmp_le32, len); in mcp251xfd_regmap_nocrc_update_bits()
135 return spi_write(spi, buf_tx, sizeof(buf_tx->cmd) + len); in mcp251xfd_regmap_nocrc_update_bits()
146 struct mcp251xfd_map_buf_nocrc *buf_tx = priv->map_buf_nocrc_tx; in mcp251xfd_regmap_nocrc_read() local
152 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16)); in mcp251xfd_regmap_nocrc_read()
155 reg_len != sizeof(buf_tx->cmd.cmd)) in mcp251xfd_regmap_nocrc_read()
163 xfer[0].len = sizeof(buf_tx->cmd); in mcp251xfd_regmap_nocrc_read()
169 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_nocrc_read()
171 xfer[0].len = sizeof(buf_tx->cmd) + val_len; in mcp251xfd_regmap_nocrc_read()
173 memcpy(&buf_tx->cmd, reg, sizeof(buf_tx->cmd)); in mcp251xfd_regmap_nocrc_read()
175 memset(buf_tx->data, 0x0, val_len); in mcp251xfd_regmap_nocrc_read()
195 struct mcp251xfd_map_buf_crc *buf_tx = priv->map_buf_crc_tx; in mcp251xfd_regmap_crc_gather_write() local
198 .tx_buf = buf_tx, in mcp251xfd_regmap_crc_gather_write()
199 .len = sizeof(buf_tx->cmd) + val_len + in mcp251xfd_regmap_crc_gather_write()
200 sizeof(buf_tx->crc), in mcp251xfd_regmap_crc_gather_write()
206 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16) + sizeof(u8)); in mcp251xfd_regmap_crc_gather_write()
209 reg_len != sizeof(buf_tx->cmd.cmd) + in mcp251xfd_regmap_crc_gather_write()
213 mcp251xfd_spi_cmd_write_crc(&buf_tx->cmd, reg, val_len); in mcp251xfd_regmap_crc_gather_write()
214 memcpy(buf_tx->data, val, val_len); in mcp251xfd_regmap_crc_gather_write()
216 crc = mcp251xfd_crc16_compute(buf_tx, sizeof(buf_tx->cmd) + val_len); in mcp251xfd_regmap_crc_gather_write()
217 put_unaligned_be16(crc, buf_tx->data + val_len); in mcp251xfd_regmap_crc_gather_write()
237 const struct mcp251xfd_map_buf_crc * const buf_tx, in mcp251xfd_regmap_crc_read_check_crc() argument
243 crc_calculated = mcp251xfd_crc16_compute2(&buf_tx->cmd, in mcp251xfd_regmap_crc_read_check_crc()
244 sizeof(buf_tx->cmd), in mcp251xfd_regmap_crc_read_check_crc()
259 const struct mcp251xfd_map_buf_crc *buf_tx = priv->map_buf_crc_tx; in mcp251xfd_regmap_crc_read_one() local
263 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16) + sizeof(u8)); in mcp251xfd_regmap_crc_read_one()
269 return mcp251xfd_regmap_crc_read_check_crc(buf_rx, buf_tx, data_len); in mcp251xfd_regmap_crc_read_one()
280 struct mcp251xfd_map_buf_crc *buf_tx = priv->map_buf_crc_tx; in mcp251xfd_regmap_crc_read() local
287 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16) + sizeof(u8)); in mcp251xfd_regmap_crc_read()
290 reg_len != sizeof(buf_tx->cmd.cmd) + in mcp251xfd_regmap_crc_read()
298 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_crc_read()
299 xfer[0].len = sizeof(buf_tx->cmd); in mcp251xfd_regmap_crc_read()
302 xfer[1].len = val_len + sizeof(buf_tx->crc); in mcp251xfd_regmap_crc_read()
305 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_crc_read()
307 xfer[0].len = sizeof(buf_tx->cmd) + val_len + in mcp251xfd_regmap_crc_read()
308 sizeof(buf_tx->crc); in mcp251xfd_regmap_crc_read()
311 memset(buf_tx->data, 0x0, val_len + in mcp251xfd_regmap_crc_read()
312 sizeof(buf_tx->crc)); in mcp251xfd_regmap_crc_read()
315 mcp251xfd_spi_cmd_read_crc(&buf_tx->cmd, reg, val_len); in mcp251xfd_regmap_crc_read()
346 buf_tx, in mcp251xfd_regmap_crc_read()