Lines Matching refs:addr
123 u8 addr; /* DLCI address + flags */
156 int addr;
455 static struct gsm_msg *gsm_data_alloc(struct gsm_mux *gsm, u8 addr, int len,
458 static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr);
619 params->d_bits = FIELD_PREP(PN_D_FIELD_DLCI, dlci->addr);
697 * @addr: address EA from the frame
707 static void gsm_print_packet(const char *hdr, int addr, int cr,
713 if (!(debug & DBG_PAYLOAD) && addr != 0)
717 pr_info("%s %d) %c: ", hdr, addr, "RC"[cr]);
801 * @addr: address for control frame
808 static int gsm_send(struct gsm_mux *gsm, int addr, int cr, int control)
815 msg = gsm_data_alloc(gsm, addr, 0, control);
824 *dp++ = (addr << 2) | (ocr << 1) | EA;
833 gsm_print_packet("Q->", addr, cr, control, NULL, 0);
854 int addr = dlci->addr;
865 if (msg->addr != addr)
877 * @addr: address for control frame
883 static inline void gsm_response(struct gsm_mux *gsm, int addr, int control)
885 gsm_send(gsm, addr, 0, control);
891 * @addr: address for control frame
897 static inline void gsm_command(struct gsm_mux *gsm, int addr, int control)
899 gsm_send(gsm, addr, 1, control);
909 * @addr: DLCI address
918 static struct gsm_msg *gsm_data_alloc(struct gsm_mux *gsm, u8 addr, int len,
927 m->addr = addr;
960 gsm_print_packet("-->", msg->addr, gsm->initiator, msg->ctrl, msg->data,
983 if (msg->addr > 0)
1051 dlci = gsm->dlci[msg->addr];
1109 *--dp = (msg->addr << 2) | CR | EA;
1111 *--dp = (msg->addr << 2) | EA;
1118 gsm_print_packet("Q> ", msg->addr, gsm->initiator, msg->ctrl,
1130 if (msg->addr > 0) {
1194 msg = gsm_data_alloc(gsm, dlci->addr, size, dlci->ftype);
1270 msg = gsm_data_alloc(gsm, dlci->addr, size, dlci->ftype);
1327 msg = gsm_data_alloc(gsm, dlci->addr, size, dlci->ftype);
1558 * @addr: DLCI address
1565 static int gsm_process_negotiation(struct gsm_mux *gsm, unsigned int addr,
1569 struct gsm_dlci *dlci = gsm->dlci[addr];
1680 unsigned int addr = 0;
1688 len = gsm_read_ea_val(&addr, data, cl);
1692 addr >>= 1;
1694 if (addr == 0 || addr >= NUM_DLCI || gsm->dlci[addr] == NULL)
1696 dlci = gsm->dlci[addr];
1732 unsigned int addr;
1744 addr = FIELD_GET(PN_D_FIELD_DLCI, params->d_bits);
1745 if (addr == 0 || addr >= NUM_DLCI || !gsm->dlci[addr]) {
1749 dlci = gsm->dlci[addr];
1758 if (gsm_process_negotiation(gsm, addr, cr, params) != 0) {
1777 gsm_command(gsm, dlci->addr, SABM|PF);
1800 unsigned int addr = 0;
1805 while (gsm_read_ea(&addr, *dp++) == 0) {
1814 addr >>= 1;
1816 if (addr == 0 || addr >= NUM_DLCI || gsm->dlci[addr] == NULL)
1823 port = &gsm->dlci[addr]->port;
2133 pr_debug("DLCI %d goes closed.\n", dlci->addr);
2137 if (dlci->addr != 0) {
2171 pr_debug("DLCI %d goes open.\n", dlci->addr);
2173 if (dlci->addr) {
2245 gsm_command(dlci->gsm, dlci->addr, SABM|PF);
2247 } else if (!dlci->addr && gsm->control == (DM | PF)) {
2250 dlci->addr);
2262 gsm_command(dlci->gsm, dlci->addr, DISC|PF);
2292 if (dlci->addr != 0) {
2295 if (dlci->prio != (roundup(dlci->addr + 1, 8) - 1))
2308 gsm_command(gsm, dlci->addr, SABM|PF);
2380 gsm_command(dlci->gsm, dlci->addr, DISC|PF);
2506 dc->channel = (u32)dlci->addr;
2602 dlci->prio = roundup(dlci->addr + 1, 8) - 1;
2631 * @addr: address of the DLCI
2638 static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
2655 dlci->addr = addr;
2658 if (addr == 0)
2661 dlci->prio = roundup(addr + 1, 8) - 1;
2665 if (addr) {
2672 gsm->dlci[addr] = dlci;
2689 dlci->gsm->dlci[dlci->addr] = NULL;
3772 unsigned int base, addr;
3802 addr = array_index_nospec(dc.channel, NUM_DLCI);
3803 dlci = gsm->dlci[addr];
3805 dlci = gsm_dlci_alloc(gsm, addr);
3818 addr = array_index_nospec(dc.channel, NUM_DLCI);
3819 dlci = gsm->dlci[addr];
3821 dlci = gsm_dlci_alloc(gsm, addr);
4089 modembits[0] = (dlci->addr << 2) | 2 | EA; /* DLCI, Valid, EA */
4419 if (dc.channel != dlci->addr)
4430 if (dc.channel != 0 && dc.channel != dlci->addr)