vserver 1.9.3
[linux-2.6.git] / drivers / net / wan / hd6457x.c
index da93cca..690a02f 100644 (file)
@@ -463,8 +463,8 @@ static void sca_set_port(port_t *port)
                        brv >>= 1; /* brv = 2^9 = 512 max in specs */
 
                        /* Baud Rate = CLOCK_BASE / TMC / 2^BR */
-                       tmc = CLOCK_BASE / (brv * port->settings.clock_rate);
-               }while(br > 1 && tmc <= 128);
+                       tmc = CLOCK_BASE / brv / port->settings.clock_rate;
+               }while (br > 1 && tmc <= 128);
 
                if (tmc < 1) {
                        tmc = 1;
@@ -473,7 +473,7 @@ static void sca_set_port(port_t *port)
                } else if (tmc > 255)
                        tmc = 256; /* tmc=0 means 256 - low baud rates */
 
-               port->settings.clock_rate = CLOCK_BASE / (brv * tmc);
+               port->settings.clock_rate = CLOCK_BASE / brv / tmc;
        } else {
                br = 9; /* Minimum clock rate */
                tmc = 256;      /* 8bit = 0 */
@@ -610,7 +610,6 @@ static void sca_close(struct net_device *dev)
        card_t* card = port_to_card(port);
 
        /* reset channel */
-       netif_stop_queue(dev);
        sca_out(CMD_RESET, get_msci(port) + CMD, port_to_card(port));
 #ifdef __HD64570_H
        /* disable MSCI interrupts */
@@ -624,6 +623,7 @@ static void sca_close(struct net_device *dev)
        sca_outl(sca_inl(IER0, card) &
                 (phy_node(port) ? 0x00FF00FF : 0xFF00FF00), IER0, card);
 #endif
+       netif_stop_queue(dev);
 }