remove obsolete locks
This commit is contained in:
parent
264ab41457
commit
bd0e323250
1 changed files with 0 additions and 13 deletions
|
@ -225,13 +225,11 @@ typedef struct mm_rx_buffer {
|
|||
* dcount : descriptor's free in queue
|
||||
* dread : next descriptor to read
|
||||
* dwrite : next descriptor to write
|
||||
* dlock : lock to protect these members
|
||||
*/
|
||||
rx_desc_t desc_table[MMNIF_MAX_DESCRIPTORS];
|
||||
uint8_t dcount;
|
||||
uint8_t dread;
|
||||
uint8_t dwrite;
|
||||
spinlock_t dlock;
|
||||
|
||||
/* acceptors
|
||||
* shared memory "hashtable" to realize
|
||||
|
@ -435,7 +433,6 @@ static uint32_t mmnif_rxbuff_alloc(uint8_t dest, uint16_t len)
|
|||
// return NULL;
|
||||
|
||||
RCCE_acquire_lock(dest-1);
|
||||
spinlock_lock(&rb->dlock);
|
||||
if (rb->dcount)
|
||||
{
|
||||
if (rb->tail > rb->head)
|
||||
|
@ -449,7 +446,6 @@ static uint32_t mmnif_rxbuff_alloc(uint8_t dest, uint16_t len)
|
|||
rb->dcount--;
|
||||
rb->dwrite = (rb->dwrite + 1) % MMNIF_MAX_DESCRIPTORS;
|
||||
rb->tail = (rb->tail + len);
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return ret;
|
||||
} else if (rb->head > len) {
|
||||
|
@ -460,11 +456,9 @@ static uint32_t mmnif_rxbuff_alloc(uint8_t dest, uint16_t len)
|
|||
rb->dcount--;
|
||||
rb->dwrite = (rb->dwrite + 1) % MMNIF_MAX_DESCRIPTORS;
|
||||
rb->tail = len;
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return ret;
|
||||
} else {
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -478,7 +472,6 @@ static uint32_t mmnif_rxbuff_alloc(uint8_t dest, uint16_t len)
|
|||
rb->dcount--;
|
||||
rb->dwrite = (rb->dwrite + 1) % MMNIF_MAX_DESCRIPTORS;
|
||||
rb->tail = (rb->tail + len);
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return ret;
|
||||
} else if (rb->tail == rb->head) {
|
||||
|
@ -495,17 +488,14 @@ static uint32_t mmnif_rxbuff_alloc(uint8_t dest, uint16_t len)
|
|||
rb->dcount--;
|
||||
rb->dwrite = (rb->dwrite + 1) % MMNIF_MAX_DESCRIPTORS;
|
||||
rb->tail = (rb->tail + len);
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return ret;
|
||||
} else {
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
spinlock_unlock(&rb->dlock);
|
||||
RCCE_release_lock(dest-1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -568,7 +558,6 @@ static void mmnif_rxbuff_free(void)
|
|||
uint32_t rpos;
|
||||
|
||||
RCCE_acquire_lock(RCCE_ue());
|
||||
spinlock_lock(&b->dlock);
|
||||
rpos = b->dread;
|
||||
|
||||
for (i = 0, j = rpos; i < MMNIF_MAX_DESCRIPTORS; i++)
|
||||
|
@ -595,7 +584,6 @@ static void mmnif_rxbuff_free(void)
|
|||
break;
|
||||
}
|
||||
|
||||
spinlock_unlock(&b->dlock);
|
||||
RCCE_release_lock(RCCE_ue());
|
||||
}
|
||||
|
||||
|
@ -1011,7 +999,6 @@ err_t mmnif_init(struct netif *netif)
|
|||
/* init the lock's for the hdr
|
||||
*/
|
||||
spinlock_init(&mmnif->rx_buff->rlock);
|
||||
spinlock_init(&mmnif->rx_buff->dlock);
|
||||
spinlock_init(&pseudolock);
|
||||
spinlock_init(&mmnif->lock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue