Commit 761cb06c authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Marcel Holtmann

[Bluetooth] Handle priority bits in parameter negotiation

The PN response have to return the same value for the priority
bits as in the request. The priority value is now also stored
in the rfcomm_dlc structure and the default value is 7.
parent 0247c40a
......@@ -185,6 +185,7 @@ struct rfcomm_dlc {
atomic_t refcnt;
u8 dlci;
u8 addr;
u8 priority;
uint mtu;
u8 v24_sig;
......
......@@ -306,6 +306,7 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
d->dlci = dlci;
d->addr = __addr(s->initiator, dlci);
d->priority = 7;
d->state = BT_CONFIG;
rfcomm_dlc_link(s, d);
......@@ -741,7 +742,7 @@ static int rfcomm_send_pn(struct rfcomm_session *s, int cr, struct rfcomm_dlc *d
pn = (void *) ptr; ptr += sizeof(*pn);
pn->dlci = d->dlci;
pn->priority = 0;
pn->priority = d->priority;
pn->ack_timer = 0;
pn->max_retrans = 0;
......@@ -1099,8 +1100,6 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
set_bit(RFCOMM_TX_THROTTLED, &d->flags);
d->credits = 0;
}
d->mtu = btohs(pn->mtu);
} else {
if (pn->flow_ctrl == 0xe0) {
d->tx_credits = pn->credits;
......@@ -1108,9 +1107,11 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
set_bit(RFCOMM_TX_THROTTLED, &d->flags);
d->credits = 0;
}
}
d->priority = pn->priority;
d->mtu = btohs(pn->mtu);
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment