diff options
author | Patrick McHardy <kaber@trash.net> | 2010-07-30 03:35:41 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-07-30 03:35:50 +0200 |
commit | 158e5c8a98919a510942888af8a00bc39db0ed8f (patch) | |
tree | 418cd4ba38546ee75af481b39b00787d457add67 /src | |
parent | dd1f1b6428bfff7118a1fc77d33961f2594b6158 (diff) |
lce: maintain transaction state (open/closed)
Will be used by the next commit to properly close the page_transaction.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/lce.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -1025,10 +1025,11 @@ int dect_ddl_open_transaction(struct dect_handle *dh, struct dect_transaction *t return -1; ddl_debug(ddl, "open transaction: %s TV: %u", protocol->name, tv); - ta->link = ddl; - ta->pd = pd; - ta->role = DECT_TRANSACTION_INITIATOR; - ta->tv = tv; + ta->link = ddl; + ta->pd = pd; + ta->role = DECT_TRANSACTION_INITIATOR; + ta->state = DECT_TRANSACTION_OPEN; + ta->tv = tv; list_add_tail(&ta->list, &ddl->transactions); return 0; @@ -1049,10 +1050,11 @@ int dect_open_transaction(struct dect_handle *dh, struct dect_transaction *ta, void dect_confirm_transaction(struct dect_handle *dh, struct dect_transaction *ta, const struct dect_transaction *req) { - ta->link = req->link; - ta->tv = req->tv; - ta->role = req->role; - ta->pd = req->pd; + ta->link = req->link; + ta->tv = req->tv; + ta->role = req->role; + ta->pd = req->pd; + ta->state = DECT_TRANSACTION_OPEN; ddl_debug(req->link, "confirm transaction: %s TV: %u Role: %u", protocols[ta->pd]->name, ta->tv, ta->role); @@ -1066,7 +1068,9 @@ void dect_close_transaction(struct dect_handle *dh, struct dect_transaction *ta, ddl_debug(ddl, "close transaction: %s TV: %u Role: %u", protocols[ta->pd]->name, ta->tv, ta->role); + list_del(&ta->list); + ta->state = DECT_TRANSACTION_CLOSED; switch (ddl->state) { case DECT_DATA_LINK_RELEASED: |