Skip to content

Conversation

@cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Mar 8, 2021

Add Radio interface to perform back-to-back transmit of PDU
with a configurable inter frame spacing.

Signed-off-by: Vinayak Kariappa Chettimada [email protected]

Copy link
Contributor

@andrzej-kaczmarek andrzej-kaczmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

tested with #31875

@cvinayak cvinayak marked this pull request as ready for review March 12, 2021 09:36

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To improve readability: can we use define's instead of hardcoded 1/0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To improve readability: can we use define's instead of hardcoded 1/0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To improve readability: can we use define's instead of hardcoded 1/0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment still correct? If (dir_curr !=0) then no such assumption is made, but flags_curr is used, right?

@cvinayak cvinayak self-assigned this Apr 6, 2021
@cvinayak cvinayak added the Enhancement Changes/Updates/Additions to existing features label Apr 6, 2021
Copy link
Contributor

@andrzej-kaczmarek andrzej-kaczmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments, verified again with #31875 and works fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SW_SWITCH_DIR_* used for both TX and RX would be less confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are aliases to hardcoded 0 or 1, used to convey the parameter name supplied to inlined sw_switch file static function. They are not intended to be used as parameter values to other functions.

Do you mean to rename to

Suggested change
#define SW_SWITCH_PREV_RX 0
#define SW_SWITCH_PREV_DIR_RX 0
#define SW_SWITCH_NEXT_DIR_RX 0
#define SW_SWITCH_PREV_DIR_TX 1
#define SW_SWITCH_NEXT_DIR_TX 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use PHY_LEGACY or even better PHY_1M instead since this is actual value passed from LLL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, macros are used as readable string (instead of using defines) which would convey the parameters purpose. Otherwise, the call at line 607 will look like:

sw_switch(SW_SWITCH_DIR_TX, SW_SWITCH_DIR_RX,
		  PHY_1M, SW_SWITCH_PREV_FLAGS_DONTCARE,
		  phy_rx, SW_SWITCH_NEXT_FLAGS_DONTCARE);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be defined in pdu.h and eventually also used in LLL since flags are magic values there as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again the macros are replacement to hardcoded values passed to sw_switch function which is vendor specific interface, not sure if other vendors will use 0 as the dont care values.

Change other magic values is outside the scope of this PR.

Copy link
Contributor Author

@cvinayak cvinayak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR depends on #31336 as that PR has resolved the conflicts of having a separate _DPPI.h header file introduced in #30732.

I have resolved conflicts in this PR over #31336 in my another branch, hence it will be less work if #31336 is merged first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are aliases to hardcoded 0 or 1, used to convey the parameter name supplied to inlined sw_switch file static function. They are not intended to be used as parameter values to other functions.

Do you mean to rename to

Suggested change
#define SW_SWITCH_PREV_RX 0
#define SW_SWITCH_PREV_DIR_RX 0
#define SW_SWITCH_NEXT_DIR_RX 0
#define SW_SWITCH_PREV_DIR_TX 1
#define SW_SWITCH_NEXT_DIR_TX 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again the macros are replacement to hardcoded values passed to sw_switch function which is vendor specific interface, not sure if other vendors will use 0 as the dont care values.

Change other magic values is outside the scope of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, macros are used as readable string (instead of using defines) which would convey the parameters purpose. Otherwise, the call at line 607 will look like:

sw_switch(SW_SWITCH_DIR_TX, SW_SWITCH_DIR_RX,
		  PHY_1M, SW_SWITCH_PREV_FLAGS_DONTCARE,
		  phy_rx, SW_SWITCH_NEXT_FLAGS_DONTCARE);

@carlescufi
Copy link
Member

@andrzej-kaczmarek can you please take another look?

@cvinayak
Copy link
Contributor Author

cvinayak commented Apr 19, 2021

This needs a rebase and also would like #31336 to go first to avoid more work resolving conflicts

Enclose macro parameters in paranthesis to avoid ambiguous
macro expansions.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Minor indentation change and replaced if-then-else-if clause
with toggle implementation.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
nRF53 implementation of sw_switch always requires Radio End
event, hence optimize out redundant code due to explicit use
of radio_tmr_end_capture.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Add Radio interface to perform back-to-back transmit of PDU
with a configurable inter frame spacing.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@carlescufi carlescufi merged commit a379196 into zephyrproject-rtos:master Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Controller area: Bluetooth Enhancement Changes/Updates/Additions to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants