-
Notifications
You must be signed in to change notification settings - Fork 660
system/i3c: added i3c tools #3290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
usage: i3c options... options: -b --bus <bus> bus to use. -m --manufid <manufid> manufacturer ID (upper 16 bits of PID). -p --partid <partid> part ID (lower 32 bits of PID). -r --read <data length> read data. -w --write <data block> Write data block. -g --get <data block> get a dev info. -h --help Output usage message and exit.)) Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
| FAR uint8_t *tmp; | ||
| uint32_t i; | ||
|
|
||
| tmp = calloc(xfer->len, sizeof(uint8_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the allocation
| uint8_t rnw; /* encodes the transfer direction. true for a read, false for a write */ | ||
| uint16_t len; /* Length of data buffer buffers, in bytes */ | ||
| FAR uint8_t *data; /* Holds pointer to userspace buffer with transmit data */ | ||
| uint8_t pad[5]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
| ****************************************************************************/ | ||
|
|
||
| static int rx_args_to_xfer(int length, int rnw, FAR uint8_t **data, | ||
| FAR char *arg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add const
| } | ||
|
|
||
| rnw = 1; | ||
| length = len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nop
| tmp[len] = (uint8_t)strtol(data_ptrs[len], NULL, 0); | ||
| } | ||
|
|
||
| length = len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nop
| case 'b': | ||
| break; | ||
| case 'r': | ||
| if (rx_args_to_xfer(xfers->len, xfers->rnw, &xfers->data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need increase xfers
|
|
||
| break; | ||
| case 'w': | ||
| if (w_args_to_xfer(xfers->len, &xfers->data, optarg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
| * Private Type | ||
| ****************************************************************************/ | ||
|
|
||
| struct i3c_ioc_priv_xfer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use i3c_priv_xfer directly
| } | ||
|
|
||
| transfers.nxfers = nxfers; | ||
| transfers.xfers = (FAR struct i3c_priv_xfer *)xfers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the casst
Note: Please adhere to Contributing Guidelines.
Summary
add i3c tools
usage: i3c options...
options:
-b --bus bus to use.
-m --manufid manufacturer ID (upper 16 bits of PID).
-p --partid part ID (lower 32 bits of PID).
-r --read read data.
-w --write Write data block.
-g --get get a dev info.
-h --help Output usage message and exit.
Impact
debug toos for i3c
Testing
local compile test and run i3c tools