FreeBSD/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
/*
 * SCO sockets LP message input routine
 */
SCO sockets LP message input routine
SCO sockets LP message input routine
static void
ng_btsocket_sco_lp_msg_input(struct ng_mesg *msg, hook_p hook)
{
	ng_btsocket_sco_rtentry_p	 rt = NULL;
	if (hook == NULL) {
		NG_BTSOCKET_SCO_ALERT(
"%s: Invalid source hook for LP message\n", __func__);
		goto drop;
	}
	rt = (ng_btsocket_sco_rtentry_p) NG_HOOK_PRIVATE(hook);
	if (rt == NULL) {
		NG_BTSOCKET_SCO_ALERT(
"%s: Could not find out source bdaddr for LP message\n", __func__);
		goto drop;
	}
	switch (msg->header.cmd) {
	case NGM_HCI_LP_CON_CFM: 
		ng_btsocket_sco_process_lp_con_cfm(msg, rt);
		break;
	case NGM_HCI_LP_CON_IND: 
		ng_btsocket_sco_process_lp_con_ind(msg, rt);
		break;
	case NGM_HCI_LP_DISCON_IND: 
		ng_btsocket_sco_process_lp_discon_ind(msg, rt);
		break;
	default:
		NG_BTSOCKET_SCO_WARN(
"%s: Unknown LP message, cmd=%d\n", __func__, msg->header.cmd);
		break;
	}
drop:
	NG_FREE_MSG(msg);
}
static void ng_btsocket_sco_lp_msg_input ( struct ng_mesg * msg , hook_p hook ) { ng_btsocket_sco_rtentry_p rt = NULL ; if ( hook == NULL ) { NG_BTSOCKET_SCO_ALERT ( " \n " , __func__ ) ; goto drop ; } rt = ( ng_btsocket_sco_rtentry_p ) NG_HOOK_PRIVATE ( hook ) ; if ( rt == NULL ) { NG_BTSOCKET_SCO_ALERT ( " \n " , __func__ ) ; goto drop ; } switch ( msg -> header . cmd ) { case NGM_HCI_LP_CON_CFM : ng_btsocket_sco_process_lp_con_cfm ( msg , rt ) ; break ; case NGM_HCI_LP_CON_IND : ng_btsocket_sco_process_lp_con_ind ( msg , rt ) ; break ; case NGM_HCI_LP_DISCON_IND : ng_btsocket_sco_process_lp_discon_ind ( msg , rt ) ; break ; default : NG_BTSOCKET_SCO_WARN ( " \n " , __func__ , msg -> header . cmd ) ; break ; } drop : NG_FREE_MSG ( msg ) ; }
SCO sockets LP message input routine
SCO sockets LP message input routine
/* Connection Confirmation Event */ /* Connection Indication Event */ /* Disconnection Indication Event */ /* XXX FIXME add other LP messages */