diff options
Diffstat (limited to 'drivers/nfc/st21nfca/i2c.c')
| -rw-r--r-- | drivers/nfc/st21nfca/i2c.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index 3f954ed86d98..ff31939978ae 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c | |||
| @@ -93,7 +93,7 @@ struct st21nfca_i2c_phy { | |||
| 93 | int hard_fault; | 93 | int hard_fault; |
| 94 | struct mutex phy_lock; | 94 | struct mutex phy_lock; |
| 95 | }; | 95 | }; |
| 96 | static u8 len_seq[] = { 13, 24, 15, 29 }; | 96 | static u8 len_seq[] = { 16, 24, 12, 29 }; |
| 97 | static u16 wait_tab[] = { 2, 3, 5, 15, 20, 40}; | 97 | static u16 wait_tab[] = { 2, 3, 5, 15, 20, 40}; |
| 98 | 98 | ||
| 99 | #define I2C_DUMP_SKB(info, skb) \ | 99 | #define I2C_DUMP_SKB(info, skb) \ |
| @@ -397,12 +397,11 @@ static int st21nfca_hci_i2c_read(struct st21nfca_i2c_phy *phy, | |||
| 397 | * The first read sequence does not start with SOF. | 397 | * The first read sequence does not start with SOF. |
| 398 | * Data is corrupeted so we drop it. | 398 | * Data is corrupeted so we drop it. |
| 399 | */ | 399 | */ |
| 400 | if (!phy->current_read_len && buf[0] != ST21NFCA_SOF_EOF) { | 400 | if (!phy->current_read_len && !IS_START_OF_FRAME(buf)) { |
| 401 | skb_trim(skb, 0); | 401 | skb_trim(skb, 0); |
| 402 | phy->current_read_len = 0; | 402 | phy->current_read_len = 0; |
| 403 | return -EIO; | 403 | return -EIO; |
| 404 | } else if (phy->current_read_len && | 404 | } else if (phy->current_read_len && IS_START_OF_FRAME(buf)) { |
| 405 | IS_START_OF_FRAME(buf)) { | ||
| 406 | /* | 405 | /* |
| 407 | * Previous frame transmission was interrupted and | 406 | * Previous frame transmission was interrupted and |
| 408 | * the frame got repeated. | 407 | * the frame got repeated. |
| @@ -487,6 +486,8 @@ static irqreturn_t st21nfca_hci_irq_thread_fn(int irq, void *phy_id) | |||
| 487 | */ | 486 | */ |
| 488 | nfc_hci_recv_frame(phy->hdev, phy->pending_skb); | 487 | nfc_hci_recv_frame(phy->hdev, phy->pending_skb); |
| 489 | phy->crc_trials = 0; | 488 | phy->crc_trials = 0; |
| 489 | } else { | ||
| 490 | kfree_skb(phy->pending_skb); | ||
| 490 | } | 491 | } |
| 491 | 492 | ||
| 492 | phy->pending_skb = alloc_skb(ST21NFCA_HCI_LLC_MAX_SIZE * 2, GFP_KERNEL); | 493 | phy->pending_skb = alloc_skb(ST21NFCA_HCI_LLC_MAX_SIZE * 2, GFP_KERNEL); |
