Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a9ce0b8 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "PAN: Remove bta_pan_co_tx_writebuf (dead code)" am: 1761f89b

Change-Id: I8421c0493f8a482a4e4c05a8328b8d9634292ca5
parents 8b65439b 1761f89b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ extern void bta_pan_ci_rx_ready(uint16_t handle);
 * Description      This function is called to enable or disable data flow on
 *                  the TX path.  The phone should call this function to
 *                  disable data flow when it is congested and cannot handle
 *                  any more data sent by bta_pan_co_tx_write() or
 *                  bta_pan_co_tx_writebuf().  This function is used when the
 *                  any more data sent by bta_pan_co_tx_write().
 *                  This function is used when the
 *                  TX data path is configured to use a push interface.
 *
 *
+0 −19
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
#define BTA_PAN_RX_PUSH_BUF 0x01 /* RX push with zero copy. */
#define BTA_PAN_RX_PULL 0x02     /* RX pull. */
#define BTA_PAN_TX_PUSH 0x00     /* TX push. */
#define BTA_PAN_TX_PUSH_BUF 0x10 /* TX push with zero copy. */
#define BTA_PAN_TX_PULL 0x20     /* TX pull. */

/*****************************************************************************
@@ -138,24 +137,6 @@ extern void bta_pan_co_tx_write(uint16_t handle, uint8_t app_id,
                                uint16_t protocol, uint8_t* p_data,
                                uint16_t len, bool ext, bool forward);

/*******************************************************************************
 *
 * Function         bta_pan_co_tx_writebuf
 *
 * Description      This function is called by PAN to send data to the phone
 *                  when the TX path is configured to use a push interface with
 *                  zero copy.  The phone must free the buffer using function
 *                  osi_free() when it is through processing the buffer.
 *
 *
 * Returns          void
 *
 ******************************************************************************/
extern void bta_pan_co_tx_writebuf(uint16_t handle, uint8_t app_id,
                                   const RawAddress& src, const RawAddress& dst,
                                   uint16_t protocol, BT_HDR* p_buf, bool ext,
                                   bool forward);

/*******************************************************************************
 *
 * Function         bta_pan_co_rx_flow
+11 −40
Original line number Diff line number Diff line
@@ -598,48 +598,19 @@ void bta_pan_rx_path(tBTA_PAN_SCB* p_scb, UNUSED_ATTR tBTA_PAN_DATA* p_data) {
 *
 ******************************************************************************/
void bta_pan_tx_path(tBTA_PAN_SCB* p_scb, UNUSED_ATTR tBTA_PAN_DATA* p_data) {
  /* if data path configured for tx pull */
  if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PULL) {
  bta_pan_pm_conn_busy(p_scb);
  /* call application callout function for tx path */
  bta_pan_co_tx_path(p_scb->handle, p_scb->app_id);

  /* free data that exceeds queue level */
    while (fixed_queue_length(p_scb->data_queue) > bta_pan_cb.q_level)
      osi_free(fixed_queue_try_dequeue(p_scb->data_queue));
    bta_pan_pm_conn_idle(p_scb);
  }
  /* if configured for zero copy push */
  else if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PUSH_BUF) {
    /* if app can accept data */
    if (p_scb->app_flow_enable) {
      BT_HDR* p_buf;

      /* read data from the queue */
      p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_scb->data_queue);
      if (p_buf != NULL) {
        /* send data to application */
        bta_pan_co_tx_writebuf(p_scb->handle, p_scb->app_id,
                               ((tBTA_PAN_DATA_PARAMS*)p_buf)->src,
                               ((tBTA_PAN_DATA_PARAMS*)p_buf)->dst,
                               ((tBTA_PAN_DATA_PARAMS*)p_buf)->protocol, p_buf,
                               ((tBTA_PAN_DATA_PARAMS*)p_buf)->ext,
                               ((tBTA_PAN_DATA_PARAMS*)p_buf)->forward);
      }
      /* free data that exceeds queue level  */
      while (fixed_queue_length(p_scb->data_queue) > bta_pan_cb.q_level)
        osi_free(fixed_queue_try_dequeue(p_scb->data_queue));

      /* if there is more data to be passed to
      upper layer */
      if (!fixed_queue_is_empty(p_scb->data_queue)) {
        p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
        p_buf->layer_specific = p_scb->handle;
        p_buf->event = BTA_PAN_RX_FROM_BNEP_READY_EVT;
        bta_sys_sendmsg(p_buf);
      }
  while (fixed_queue_length(p_scb->data_queue) > bta_pan_cb.q_level) {
    BT_HDR* p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_scb->data_queue);
    if (p_buf != nullptr) {
      osi_free(p_buf);
    }
  }

  bta_pan_pm_conn_idle(p_scb);
}

/*******************************************************************************
+2 −2
Original line number Diff line number Diff line
@@ -89,8 +89,8 @@ void bta_pan_ci_rx_ready(uint16_t handle) {
 * Description      This function is called to enable or disable data flow on
 *                  the TX path.  The phone should call this function to
 *                  disable data flow when it is congested and cannot handle
 *                  any more data sent by bta_pan_co_tx_write() or
 *                  bta_pan_co_tx_writebuf().  This function is used when the
 *                  any more data sent by bta_pan_co_tx_write().
 *                  This function is used when the
 *                  TX data path is configured to use a push interface.
 *
 *
+0 −23
Original line number Diff line number Diff line
@@ -233,29 +233,6 @@ void bta_pan_co_tx_write(UNUSED_ATTR uint16_t handle,
  BTIF_TRACE_API("bta_pan_co_tx_write not used");
}

/*******************************************************************************
 *
 * Function         bta_pan_co_tx_writebuf
 *
 * Description      This function is called by PAN to send data to the phone
 *                  when the TX path is configured to use a push interface with
 *                  zero copy.  The phone must free the buffer using function
 *                  osi_free() when it is through processing the buffer.
 *
 *
 * Returns          true if flow enabled
 *
 ******************************************************************************/
void bta_pan_co_tx_writebuf(UNUSED_ATTR uint16_t handle,
                            UNUSED_ATTR uint8_t app_id,
                            UNUSED_ATTR const RawAddress& src,
                            UNUSED_ATTR const RawAddress& dst,
                            UNUSED_ATTR uint16_t protocol,
                            UNUSED_ATTR BT_HDR* p_buf, UNUSED_ATTR bool ext,
                            UNUSED_ATTR bool forward) {
  BTIF_TRACE_API("bta_pan_co_tx_writebuf not used");
}

/*******************************************************************************
 *
 * Function         bta_pan_co_rx_flow