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()
89 struct mcp251xfd_map_buf_nocrc *buf_tx = priv->map_buf_nocrc_tx; in mcp251xfd_regmap_nocrc_update_bits() local
95 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16)); in mcp251xfd_regmap_nocrc_update_bits()
113 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_nocrc_update_bits()
114 xfer[0].len = sizeof(buf_tx->cmd); in mcp251xfd_regmap_nocrc_update_bits()
120 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_nocrc_update_bits()
122 xfer[0].len = sizeof(buf_tx->cmd) + len; in mcp251xfd_regmap_nocrc_update_bits()
125 memset(buf_tx->data, 0x0, len); in mcp251xfd_regmap_nocrc_update_bits()
128 mcp251xfd_spi_cmd_read_nocrc(&buf_tx->cmd, reg + first_byte); in mcp251xfd_regmap_nocrc_update_bits()
142 mcp251xfd_spi_cmd_write_nocrc(&buf_tx->cmd, reg + first_byte); in mcp251xfd_regmap_nocrc_update_bits()
143 memcpy(buf_tx->data, &tmp_le32, len); in mcp251xfd_regmap_nocrc_update_bits()
145 return spi_write(spi, buf_tx, sizeof(buf_tx->cmd) + len); in mcp251xfd_regmap_nocrc_update_bits()
156 struct mcp251xfd_map_buf_nocrc *buf_tx = priv->map_buf_nocrc_tx; in mcp251xfd_regmap_nocrc_read() local
162 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16)); in mcp251xfd_regmap_nocrc_read()
165 reg_len != sizeof(buf_tx->cmd.cmd)) in mcp251xfd_regmap_nocrc_read()
173 xfer[0].len = sizeof(buf_tx->cmd); in mcp251xfd_regmap_nocrc_read()
179 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_nocrc_read()
181 xfer[0].len = sizeof(buf_tx->cmd) + val_len; in mcp251xfd_regmap_nocrc_read()
183 memcpy(&buf_tx->cmd, reg, sizeof(buf_tx->cmd)); in mcp251xfd_regmap_nocrc_read()
185 memset(buf_tx->data, 0x0, val_len); in mcp251xfd_regmap_nocrc_read()
205 struct mcp251xfd_map_buf_crc *buf_tx = priv->map_buf_crc_tx; in mcp251xfd_regmap_crc_gather_write() local
208 .tx_buf = buf_tx, in mcp251xfd_regmap_crc_gather_write()
209 .len = sizeof(buf_tx->cmd) + val_len + in mcp251xfd_regmap_crc_gather_write()
210 sizeof(buf_tx->crc), in mcp251xfd_regmap_crc_gather_write()
216 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16) + sizeof(u8)); in mcp251xfd_regmap_crc_gather_write()
219 reg_len != sizeof(buf_tx->cmd.cmd) + in mcp251xfd_regmap_crc_gather_write()
223 mcp251xfd_spi_cmd_write_crc(&buf_tx->cmd, reg, val_len); in mcp251xfd_regmap_crc_gather_write()
224 memcpy(buf_tx->data, val, val_len); in mcp251xfd_regmap_crc_gather_write()
226 crc = mcp251xfd_crc16_compute(buf_tx, sizeof(buf_tx->cmd) + val_len); in mcp251xfd_regmap_crc_gather_write()
227 put_unaligned_be16(crc, buf_tx->data + val_len); in mcp251xfd_regmap_crc_gather_write()
247 const struct mcp251xfd_map_buf_crc * const buf_tx, in mcp251xfd_regmap_crc_read_check_crc() argument
253 crc_calculated = mcp251xfd_crc16_compute2(&buf_tx->cmd, in mcp251xfd_regmap_crc_read_check_crc()
254 sizeof(buf_tx->cmd), in mcp251xfd_regmap_crc_read_check_crc()
268 const struct mcp251xfd_map_buf_crc *buf_tx = priv->map_buf_crc_tx; in mcp251xfd_regmap_crc_read_one() local
272 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16) + sizeof(u8)); in mcp251xfd_regmap_crc_read_one()
278 return mcp251xfd_regmap_crc_read_check_crc(buf_rx, buf_tx, data_len); in mcp251xfd_regmap_crc_read_one()
289 struct mcp251xfd_map_buf_crc *buf_tx = priv->map_buf_crc_tx; in mcp251xfd_regmap_crc_read() local
296 BUILD_BUG_ON(sizeof(buf_tx->cmd) != sizeof(__be16) + sizeof(u8)); in mcp251xfd_regmap_crc_read()
299 reg_len != sizeof(buf_tx->cmd.cmd) + in mcp251xfd_regmap_crc_read()
307 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_crc_read()
308 xfer[0].len = sizeof(buf_tx->cmd); in mcp251xfd_regmap_crc_read()
311 xfer[1].len = val_len + sizeof(buf_tx->crc); in mcp251xfd_regmap_crc_read()
314 xfer[0].tx_buf = buf_tx; in mcp251xfd_regmap_crc_read()
316 xfer[0].len = sizeof(buf_tx->cmd) + val_len + in mcp251xfd_regmap_crc_read()
317 sizeof(buf_tx->crc); in mcp251xfd_regmap_crc_read()
320 memset(buf_tx->data, 0x0, val_len + in mcp251xfd_regmap_crc_read()
321 sizeof(buf_tx->crc)); in mcp251xfd_regmap_crc_read()
324 mcp251xfd_spi_cmd_read_crc(&buf_tx->cmd, reg, val_len); in mcp251xfd_regmap_crc_read()
357 buf_tx, in mcp251xfd_regmap_crc_read()