OSDN Git Service

GKI cleanup - Replaced usage of GKI queue with OSI fixed_queue
authorPavlin Radoslavov <pavlin@google.com>
Fri, 25 Sep 2015 18:21:15 +0000 (11:21 -0700)
committerScott James Remnant <keybuk@google.com>
Mon, 19 Oct 2015 17:36:28 +0000 (10:36 -0700)
commit1a3844f933bd63c8a381371dabfb35c6a0249e3e
tree94d631a2020ae33d9cfae6ccc9ea42bee1ee7a02
parent1eb1ea0cf2da992a3193506806e571dcbe3ec947
GKI cleanup - Replaced usage of GKI queue with OSI fixed_queue

* Added new functions to OSI:
  - fixed_queue_init()
  - fixed_queue_length()
  - fixed_queue_try_remove_from_queue()
  - fixed_queue_try_peek_last()

* Renamed fixed_queue_try_peek() to fixed_queue_try_peek_first()

* Replaced usage of GKI queue functions with OSI fixed_queue functions:
  - GKI_init_q() -> fixed_queue_new(SIZE_MAX)
    NOTE: unlike GKI_init_q(), fixed_queue_new() allocates memory /
    state that needs to be released by calling fixed_queue_free()
  - GKI_enqueue() -> fixed_queue_enqueue()
  - GKI_dequeue() -> fixed_queue_try_dequeue()
    NOTE: fixed_queue_try_dequeue() is non-blocking
  - GKI_queue_length() -> fixed_queue_length()
  - GKI_queue_is_empty() -> fixed_queue_is_empty()
  - GKI_getfirst() -> fixed_queue_try_peek_first()
  - GKI_getlast() -> fixed_queue_try_peek_last()
  - GKI_remove_from_queue() -> fixed_queue_try_remove_from_queue()
  - Queue elements iteration.
    In the fixed_queue implementation we have to use the underlying
    list_t mechanism to iterate over the elements.
    OLD:
      p = GKI_getfirst(queue);
      ...
      while ((p = GKI_getnext(p) != NULL) {
         ...
      }
    NEW:
      list_t *list = fixed_queue_get_list(queue);
      for (const list_node_t *node = list_begin(list);
           node != list_end(list); node = list_next(node)) {
          p = list_node(node);
      }

* Remove initialization of the GKI module, because it is not needed
  anymore

* Removed unused files in GKI:
  gki/common/gki_common.h
  gki/ulinux/gki_int.h
  gki/ulinux/gki_ulinux.c

Change-Id: I3ff9464db75252d6faf7476a9ca67c88e535c51c
79 files changed:
bta/Android.mk
bta/BUILD.gn
bta/gatt/bta_gattc_act.c
bta/gatt/bta_gattc_cache.c
bta/gatt/bta_gattc_int.h
bta/gatt/bta_gattc_utils.c
bta/pan/bta_pan_act.c
bta/pan/bta_pan_ci.c
bta/pan/bta_pan_int.h
bta/pan/bta_pan_main.c
bta/sys/bta_sys_main.c
btif/src/btif_media_task.c
btif/src/btif_sock_l2cap.c
gki/Android.mk
gki/BUILD.gn
gki/common/gki.h
gki/common/gki_buffer.c
gki/common/gki_common.h [deleted file]
gki/ulinux/gki_int.h [deleted file]
gki/ulinux/gki_ulinux.c [deleted file]
hci/Android.mk
hci/src/hci_layer.c
main/Android.mk
main/BUILD.gn
main/bte_main.c
osi/include/fixed_queue.h
osi/src/fixed_queue.c
stack/Android.mk
stack/BUILD.gn
stack/avct/avct_int.h
stack/avct/avct_lcb.c
stack/avct/avct_lcb_act.c
stack/avdt/avdt_api.c
stack/avdt/avdt_ccb.c
stack/avdt/avdt_ccb_act.c
stack/avdt/avdt_int.h
stack/avdt/avdt_msg.c
stack/avdt/avdt_scb.c
stack/avdt/avdt_scb_act.c
stack/bnep/bnep_api.c
stack/bnep/bnep_int.h
stack/bnep/bnep_main.c
stack/bnep/bnep_utils.c
stack/btm/btm_acl.c
stack/btm/btm_ble_bgconn.c
stack/btm/btm_ble_gap.c
stack/btm/btm_ble_int.h
stack/btm/btm_int.h
stack/btm/btm_main.c
stack/btm/btm_pm.c
stack/btm/btm_sco.c
stack/btm/btm_sec.c
stack/btu/btu_init.c
stack/gap/gap_ble.c
stack/gap/gap_conn.c
stack/gap/gap_int.h
stack/gatt/gatt_api.c
stack/gatt/gatt_auth.c
stack/gatt/gatt_db.c
stack/gatt/gatt_int.h
stack/gatt/gatt_main.c
stack/gatt/gatt_sr.c
stack/gatt/gatt_utils.c
stack/l2cap/l2c_api.c
stack/l2cap/l2c_csm.c
stack/l2cap/l2c_fcr.c
stack/l2cap/l2c_int.h
stack/l2cap/l2c_link.c
stack/l2cap/l2c_main.c
stack/l2cap/l2c_ucd.c
stack/l2cap/l2c_utils.c
stack/rfcomm/port_api.c
stack/rfcomm/port_int.h
stack/rfcomm/port_rfc.c
stack/rfcomm/port_utils.c
stack/rfcomm/rfc_l2cap_if.c
stack/rfcomm/rfc_mx_fsm.c
stack/rfcomm/rfc_port_fsm.c
stack/rfcomm/rfc_utils.c