Lines Matching defs:bcs
41 modehscx(struct BCState *bcs, int mode, int bc)
43 struct IsdnCardState *cs = bcs->cs;
44 int hscx = bcs->hw.hscx.hscx;
49 bcs->mode = mode;
50 bcs->channel = bc;
68 test_bit(HW_IOM1, &cs->HW_Flags) ? 0x7 : bcs->hw.hscx.tsaxr0);
70 test_bit(HW_IOM1, &cs->HW_Flags) ? 0x7 : bcs->hw.hscx.tsaxr0);
72 cs->BC_Write_Reg(cs, hscx, HSCX_TSAX, bcs->hw.hscx.tsaxr1);
73 cs->BC_Write_Reg(cs, hscx, HSCX_TSAR, bcs->hw.hscx.tsaxr1);
98 struct BCState *bcs = st->l1.bcs;
104 spin_lock_irqsave(&bcs->cs->lock, flags);
105 if (bcs->tx_skb) {
106 skb_queue_tail(&bcs->squeue, skb);
108 bcs->tx_skb = skb;
109 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag);
110 bcs->hw.hscx.count = 0;
111 bcs->cs->BC_Send_Data(bcs);
113 spin_unlock_irqrestore(&bcs->cs->lock, flags);
116 spin_lock_irqsave(&bcs->cs->lock, flags);
117 if (bcs->tx_skb) {
120 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag);
121 bcs->tx_skb = skb;
122 bcs->hw.hscx.count = 0;
123 bcs->cs->BC_Send_Data(bcs);
125 spin_unlock_irqrestore(&bcs->cs->lock, flags);
128 if (!bcs->tx_skb) {
135 spin_lock_irqsave(&bcs->cs->lock, flags);
136 test_and_set_bit(BC_FLG_ACTIV, &bcs->Flag);
137 modehscx(bcs, st->l1.mode, st->l1.bc);
138 spin_unlock_irqrestore(&bcs->cs->lock, flags);
145 spin_lock_irqsave(&bcs->cs->lock, flags);
146 test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag);
147 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
148 modehscx(bcs, 0, st->l1.bc);
149 spin_unlock_irqrestore(&bcs->cs->lock, flags);
156 close_hscxstate(struct BCState *bcs)
158 modehscx(bcs, 0, bcs->channel);
159 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
160 kfree(bcs->hw.hscx.rcvbuf);
161 bcs->hw.hscx.rcvbuf = NULL;
162 kfree(bcs->blog);
163 bcs->blog = NULL;
164 skb_queue_purge(&bcs->rqueue);
165 skb_queue_purge(&bcs->squeue);
166 if (bcs->tx_skb) {
167 dev_kfree_skb_any(bcs->tx_skb);
168 bcs->tx_skb = NULL;
169 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
175 open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs)
177 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
178 if (!(bcs->hw.hscx.rcvbuf = kmalloc(HSCX_BUFMAX, GFP_ATOMIC))) {
181 test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
184 if (!(bcs->blog = kmalloc(MAX_BLOG_SPACE, GFP_ATOMIC))) {
186 "HiSax: No memory for bcs->blog\n");
187 test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
188 kfree(bcs->hw.hscx.rcvbuf);
189 bcs->hw.hscx.rcvbuf = NULL;
192 skb_queue_head_init(&bcs->rqueue);
193 skb_queue_head_init(&bcs->squeue);
195 bcs->tx_skb = NULL;
196 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
197 bcs->event = 0;
198 bcs->hw.hscx.rcvidx = 0;
199 bcs->tx_cnt = 0;
204 setstack_hscx(struct PStack *st, struct BCState *bcs)
206 bcs->channel = st->l1.bc;
207 if (open_hscxstate(st->l1.hardware, bcs))
209 st->l1.bcs = bcs;
212 bcs->st = st;
246 cs->bcs[0].BC_SetStack = setstack_hscx;
247 cs->bcs[1].BC_SetStack = setstack_hscx;
248 cs->bcs[0].BC_Close = close_hscxstate;
249 cs->bcs[1].BC_Close = close_hscxstate;
250 cs->bcs[0].hw.hscx.hscx = 0;
251 cs->bcs[1].hw.hscx.hscx = 1;
252 cs->bcs[0].hw.hscx.tsaxr0 = 0x2f;
253 cs->bcs[0].hw.hscx.tsaxr1 = 3;
254 cs->bcs[1].hw.hscx.tsaxr0 = 0x2f;
255 cs->bcs[1].hw.hscx.tsaxr1 = 3;
256 modehscx(cs->bcs, 0, 0);
257 modehscx(cs->bcs + 1, 0, 0);