Lines Matching refs:mode

48  * it automatically uses single slot when entering SNIFF mode, but does not restore the setting
178 ** Description store the mode in control block or
190 tBTM_PM_MODE mode;
200 BTM_TRACE_API( "BTM_SetPowerMode: pm_id %d BDA: %08x mode:0x%x", pm_id,
201 (remote_bda[2]<<24)+(remote_bda[3]<<16)+(remote_bda[4]<<8)+remote_bda[5], p_mode->mode);
204 mode = p_mode->mode & ~BTM_PM_MD_FORCE;
212 if(mode != BTM_PM_MD_ACTIVE)
214 /* check if the requested mode is supported */
215 ind = mode - BTM_PM_MD_HOLD; /* make it base 0 */
221 if(mode == p_cb->state) /* the requested mode is current mode */
223 /* already in the requested mode and the current interval has less latency than the max */
224 if( (mode == BTM_PM_MD_ACTIVE) ||
225 ((p_mode->mode & BTM_PM_MD_FORCE) && (p_mode->max >= p_cb->interval) && (p_mode->min <= p_cb->interval)) ||
226 ((p_mode->mode & BTM_PM_MD_FORCE)==0 && (p_mode->max >= p_cb->interval)) )
228 BTM_TRACE_DEBUG( "BTM_SetPowerMode: mode:0x%x interval %d max:%d, min:%d", p_mode->mode, p_cb->interval, p_mode->max, p_mode->min);
237 /* update mode database */
254 /* if mode == hold or pending, return */
277 ** Description This returns the current mode for a specific
282 ** Output Param p_mode - address where the current mode is copied into.
309 ** connection if it is in ACTIVE mode.
441 ** Description get the "more active" mode of the 2
452 p_res->mode &= ~BTM_PM_MD_FORCE;
457 if(p_md2->mode == BTM_PM_MD_ACTIVE || p_md1->mode == BTM_PM_MD_ACTIVE)
463 if(p_md1->mode & BTM_PM_MD_FORCE)
466 p_res->mode &= ~BTM_PM_MD_FORCE;
470 if(p_md2->mode & BTM_PM_MD_FORCE)
473 p_res->mode &= ~BTM_PM_MD_FORCE;
477 res = (p_md1->mode - 1) * BTM_PM_NUM_SET_MODES + (p_md2->mode - 1);
490 p_res->mode = p_md1->mode;
500 if(p_res->mode == BTM_PM_MD_SNIFF)
514 ** Description get the resulting mode from the registered parties, then compare it
515 ** with the requested mode, if the command is from an unregistered party.
524 if(p_mode != NULL && p_mode->mode & BTM_PM_MD_FORCE)
527 p_res->mode &= ~BTM_PM_MD_FORCE;
528 return p_res->mode;
541 if(p_cb->req_mode[xx].mode == BTM_PM_MD_ACTIVE)
556 /* if the resulting mode is NULL(nobody registers SET), use the requested mode */
567 compare the resulting mode from registered party*/
573 return p_res->mode;
579 ** Description get the resulting mode and send the resuest to host controller
586 tBTM_PM_MODE mode;
590 mode = btm_pm_get_set_mode(pm_id, p_cb, p_mode, &md_res);
591 md_res.mode = mode;
594 BTM_TRACE_DEBUG( "btm_pm_snd_md_req link_ind:%d, mode: %d",
595 link_ind, mode);
598 if( p_cb->state == mode)
600 /* already in the resulting mode */
601 if( (mode == BTM_PM_MD_ACTIVE) ||
609 /* cannot go directly from current mode to resulting mode. */
610 if( mode != BTM_PM_MD_ACTIVE && p_cb->state != BTM_PM_MD_ACTIVE)
614 md_res.mode = BTM_PM_MD_ACTIVE;
616 else if(BTM_PM_MD_SNIFF == md_res.mode && p_cb->max_lat)
632 switch(md_res.mode)
779 ** Description This function is called when an HCI mode change event occurs.
783 ** mode - HCI_MODE_ACTIVE, HCI_MODE_HOLD, HCI_MODE_SNIFF, or HCI_MODE_PARK
784 ** interval - number of baseband slots (meaning depends on mode)
789 void btm_pm_proc_mode_change (UINT8 hci_status, UINT16 hci_handle, UINT8 mode, UINT16 interval)
803 /*** 2035 and 2045 work around: If mode is active and coming out of a SCO disconnect, restore packet types ***/
804 if (mode == HCI_MODE_ACTIVE)
810 BTM_TRACE_DEBUG("btm mode change AFTER unsniffing; hci hdl 0x%x, types 0x%02x/0x%02x",
819 BTM_TRACE_DEBUG("btm mode change AFTER unsniffing; hci hdl 0x%x, types 0x%02x",
829 /* Packet types of active mode, not sniff mode, should be used for ACL when SCO is closed. */
838 else if (mode == HCI_MODE_SNIFF)
840 BTM_TRACE_DEBUG("btm mode change to sniff; hci hdl 0x%x use single slot",
849 p_cb->state = mode;
861 BTM_TRACE_DEBUG("btm mode change to active; check l2c_link for outgoing packets");
869 /* set req_mode HOLD mode->ACTIVE */
870 if( (mode == BTM_PM_MD_ACTIVE) && (p_cb->req_mode[yy].mode == BTM_PM_MD_HOLD) )
871 p_cb->req_mode[yy].mode = BTM_PM_MD_ACTIVE;
903 (*btm_cb.pm_reg_db[yy].cback)( p->remote_addr, mode, interval, hci_status);
907 /* If mode change was because of an active role switch or change link key */
1013 ** Description This function is called to check if in active or sniff mode
1015 ** Returns TRUE, if in active or sniff mode
1020 /* The active state is the highest state-includes connected device and sniff mode*/
1046 ** Description This function is called to check if in paging, inquiry or connecting mode
1048 ** Returns TRUE, if in paging, inquiry or connecting mode