1.移除设备对象中的读写fifo。

This commit is contained in:
MacRsh
2023-09-23 18:25:01 +08:00
parent dfff675500
commit a7617e3c84
2 changed files with 0 additions and 10 deletions

View File

@@ -357,8 +357,6 @@ struct mr_device
mr_uint8_t oflags; /* Open mode flags */
mr_uint8_t reserved; /* Reserved */
mr_size_t ref_count; /* Number of references */
struct mr_rb rx_fifo; /* Receive FIFO */
struct mr_rb tx_fifo; /* Transmit FIFO */
mr_err_t (*rx_cb)(mr_device_t device, void *args); /* Receive the completed callback */
mr_err_t (*tx_cb)(mr_device_t device, void *args); /* Send completion callback */

View File

@@ -70,8 +70,6 @@ mr_err_t mr_device_add(mr_device_t device,
device->sflags = sflags;
device->oflags = MR_DEVICE_OFLAG_CLOSED;
device->ref_count = 0;
mr_rb_init(&device->rx_fifo, MR_NULL, 0);
mr_rb_init(&device->tx_fifo, MR_NULL, 0);
device->rx_cb = MR_NULL;
device->tx_cb = MR_NULL;
@@ -115,10 +113,6 @@ mr_err_t mr_device_remove(mr_device_t device)
return ret;
}
/* Reset the device */
mr_rb_allocate_buffer(&device->rx_fifo, 0);
mr_rb_allocate_buffer(&device->tx_fifo, 0);
return ret;
}
@@ -199,8 +193,6 @@ mr_err_t mr_device_close(mr_device_t device)
/* Set the device status to closed */
device->oflags = MR_DEVICE_OFLAG_CLOSED;
mr_rb_reset(&device->rx_fifo);
mr_rb_reset(&device->tx_fifo);
device->rx_cb = MR_NULL;
device->tx_cb = MR_NULL;