| 205 | */ |
| 206 | |
| 207 | int |
| 208 | ng_l2cap_discon_timeout(ng_l2cap_con_p con) |
| 209 | { |
| 210 | if (con->flags & (NG_L2CAP_CON_LP_TIMO|NG_L2CAP_CON_AUTO_DISCON_TIMO)) |
| 211 | panic( |
| 212 | "%s: %s - invalid timeout, state=%d, flags=%#x\n", |
| 213 | __func__, NG_NODE_NAME(con->l2cap->node), |
| 214 | con->state, con->flags); |
| 215 | |
| 216 | con->flags |= NG_L2CAP_CON_AUTO_DISCON_TIMO; |
| 217 | ng_callout(&con->con_timo, con->l2cap->node, NULL, |
| 218 | con->l2cap->discon_timo * hz, |
| 219 | ng_l2cap_process_discon_timeout, NULL, |
| 220 | con->con_handle); |
| 221 | |
| 222 | return (0); |
| 223 | } /* ng_l2cap_discon_timeout */ |
| 224 | |
| 225 | /* |
| 226 | * Unset auto disconnect timeout |
no test coverage detected