-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'spinler-fixes-misc' into 'devel'
Spinler fixes misc See merge request ndk/swbase!73
- Loading branch information
Showing
9 changed files
with
158 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
* Martin Spinler <[email protected]> | ||
*/ | ||
|
||
#include <linux/delay.h> | ||
|
||
#include "ndp.h" | ||
|
||
size_t ndp_subscription_rx_data_available(struct ndp_subscription *sub) | ||
|
@@ -64,14 +66,26 @@ int ndp_subscription_start(struct ndp_subscription *sub, | |
return 0; | ||
} | ||
|
||
void ndp_subscription_stop(struct ndp_subscription *sub) | ||
int ndp_subscription_stop(struct ndp_subscription *sub, int force) | ||
{ | ||
int ret; | ||
if (sub->status != NDP_SUB_STATUS_RUNNING) { | ||
//dev_warn("Trying to stop not started subscription."); | ||
return; | ||
//return -EBADF; | ||
return 0; | ||
} | ||
ndp_channel_stop(sub); | ||
ret = ndp_channel_stop(sub, 0); | ||
if (ret == -EAGAIN) { | ||
if (force) { | ||
msleep(10); | ||
ndp_channel_stop(sub, 1); | ||
} else { | ||
return ret; | ||
} | ||
} | ||
|
||
sub->status = NDP_SUB_STATUS_SUBSCRIBED; | ||
return 0; | ||
} | ||
|
||
struct ndp_subscription *ndp_subscription_create( | ||
|
@@ -146,7 +160,7 @@ void ndp_subscription_destroy(struct ndp_subscription *sub) | |
struct ndp *ndp = subscriber->ndp; | ||
|
||
if (sub->status == NDP_SUB_STATUS_RUNNING) { | ||
ndp_subscription_stop(sub); | ||
ndp_subscription_stop(sub, 1); | ||
} | ||
|
||
ndp_channel_unsubscribe(sub); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.