void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu,

                int (*new_channel)(struct bt_l2cap_device_s *dev,

                        struct bt_l2cap_conn_params_s *params))

{

    struct bt_l2cap_psm_s *new_psm = l2cap_psm(dev, psm);



    if (new_psm) {

        fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n",

                        __FUNCTION__, psm, dev->device.lmp_name);

        exit(-1);

    }



    new_psm = g_malloc0(sizeof(*new_psm));

    new_psm->psm = psm;

    new_psm->min_mtu = min_mtu;

    new_psm->new_channel = new_channel;

    new_psm->next = dev->first_psm;

    dev->first_psm = new_psm;

}

void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu,

                int (*new_channel)(struct bt_l2cap_device_s *dev,

                        struct bt_l2cap_conn_params_s *params))

{

    struct bt_l2cap_psm_s *new_psm = l2cap_psm(dev, psm);



    if (new_psm) {

        fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n",

                        __FUNCTION__, psm, dev->device.lmp_name);

        exit(-1);

    }



    new_psm = g_malloc0(sizeof(*new_psm));

    new_psm->psm = psm;

    new_psm->min_mtu = min_mtu;

    new_psm->new_channel = new_channel;

    new_psm->next = dev->first_psm;

    dev->first_psm = new_psm;

}

void FUNC_0(struct bt_l2cap_device_s *VAR_4, int VAR_1, int VAR_2,

                int (*VAR_3)(struct bt_l2cap_device_s *VAR_4,

                        struct bt_l2cap_conn_params_s *VAR_4))

{

    struct bt_l2cap_psm_s *VAR_5 = l2cap_psm(VAR_4, VAR_1);



    if (VAR_5) {

        fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n",

                        __FUNCTION__, VAR_1, VAR_4->device.lmp_name);

        exit(-1);

    }



    VAR_5 = g_malloc0(sizeof(*VAR_5));

    VAR_5->VAR_1 = VAR_1;

    VAR_5->VAR_2 = VAR_2;

    VAR_5->VAR_3 = VAR_3;

    VAR_5->next = VAR_4->first_psm;

    VAR_4->first_psm = VAR_5;

}

void FUNC_0(struct bt_l2cap_device_s *VAR_4, int VAR_1, int VAR_2,
int (*VAR_3)(struct bt_l2cap_device_s *VAR_4,
struct bt_l2cap_conn_params_s *VAR_4))
{ struct bt_l2cap_psm_s *VAR_5 = l2cap_psm(VAR_4, VAR_1); if (VAR_5) { fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n",
__FUNCTION__, VAR_1, VAR_4->device.lmp_name); exit(-1); } VAR_5 = g_malloc0(sizeof(*VAR_5)); VAR_5->VAR_1 = VAR_1; VAR_5->VAR_2 = VAR_2; VAR_5->VAR_3 = VAR_3; VAR_5->next = VAR_4->first_psm; VAR_4->first_psm = VAR_5; }