···3333#include <linux/interrupt.h>3434#include <linux/poison.h>3535#include <linux/bitrev.h>3636+#include <linux/mutex.h>36373738#include <asm/atomic.h>3839#include <asm/io.h>···1178117711791178 vcc->tx_frame_bits = tx_frame_bits;1180117911811181- down (&dev->vcc_sf);11801180+ mutex_lock(&dev->vcc_sf);11821181 if (dev->rxer[vci]) {11831182 // RXer on the channel already, just modify rate...11841183 cmd.request = cpu_to_be32 (SRB_MODIFY_VC_RATE);···12041203 schedule();12051204 }12061205 dev->txer[vci].tx_present = 1;12071207- up (&dev->vcc_sf);12061206+ mutex_unlock(&dev->vcc_sf);12081207 }1209120812101209 if (rxtp->traffic_class != ATM_NONE) {···1212121112131212 vcc->rx_info.pool = pool;1214121312151215- down (&dev->vcc_sf); 12141214+ mutex_lock(&dev->vcc_sf);12161215 /* grow RX buffer pool */12171216 if (!dev->rxq[pool].buffers_wanted)12181217 dev->rxq[pool].buffers_wanted = rx_lats;···12381237 schedule();12391238 // this link allows RX frames through12401239 dev->rxer[vci] = atm_vcc;12411241- up (&dev->vcc_sf);12401240+ mutex_unlock(&dev->vcc_sf);12421241 }1243124212441243 // indicate readiness···12631262 if (atm_vcc->qos.txtp.traffic_class != ATM_NONE) {12641263 command cmd;1265126412661266- down (&dev->vcc_sf);12651265+ mutex_lock(&dev->vcc_sf);12671266 if (dev->rxer[vci]) {12681267 // RXer still on the channel, just modify rate... XXX not really needed12691268 cmd.request = cpu_to_be32 (SRB_MODIFY_VC_RATE);···12781277 dev->txer[vci].tx_present = 0;12791278 while (command_do (dev, &cmd))12801279 schedule();12811281- up (&dev->vcc_sf);12801280+ mutex_unlock(&dev->vcc_sf);12821281 }1283128212841283 // disable RXing···12881287 // this is (the?) one reason why we need the amb_vcc struct12891288 unsigned char pool = vcc->rx_info.pool;1290128912911291- down (&dev->vcc_sf);12901290+ mutex_lock(&dev->vcc_sf);12921291 if (dev->txer[vci].tx_present) {12931292 // TXer still on the channel, just go to pool zero XXX not really needed12941293 cmd.request = cpu_to_be32 (SRB_MODIFY_VC_FLAGS);···13151314 dev->rxq[pool].buffers_wanted = 0;13161315 drain_rx_pool (dev, pool);13171316 }13181318- up (&dev->vcc_sf);13171317+ mutex_unlock(&dev->vcc_sf);13191318 }1320131913211320 // free our structure···2189218821902189 // semaphore for txer/rxer modifications - we cannot use a21912190 // spinlock as the critical region needs to switch processes21922192- init_MUTEX (&dev->vcc_sf);21912191+ mutex_init(&dev->vcc_sf);21932192 // queue manipulation spinlocks; we want atomic reads and21942193 // writes to the queue descriptors (handles IRQ and SMP)21952194 // consider replacing "int pending" -> "atomic_t available"