Move C labels to start-of-line
[coreboot.git] / src / lib / xmodem.c
index aca6e49d581195acf3f2886d0b7855dbff8d5400..a00653a7311779b812762fb5378e34f5bf5b5166 100644 (file)
 
     You should have received a copy of the GNU Lesser General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
 #include <string.h>
 #include <delay.h>
-
-extern void uart8250_tx_byte(unsigned, unsigned char);
-extern int uart8250_can_rx_byte(unsigned);
-extern unsigned char uart8250_rx_byte(unsigned);
+#include <uart8250.h>
 
 static int _inbyte(int msec)
 {
-       while (!uart8250_can_rx_byte(TTYS0_BASE)) {
+       while (!uart8250_can_rx_byte(CONFIG_TTYS0_BASE)) {
                udelay(1000);
                if (msec-- <= 0)
                        return -1;
        }
-       return uart8250_rx_byte(TTYS0_BASE);
+       return uart8250_rx_byte(CONFIG_TTYS0_BASE);
 }
 
 static void _outbyte(unsigned char c)
 {
-       uart8250_tx_byte(TTYS0_BASE, c);
+       uart8250_tx_byte(CONFIG_TTYS0_BASE, c);
 }
 
 static unsigned short crc16_ccitt(const unsigned char *buf, int sz)
@@ -146,7 +143,7 @@ int xmodemReceive(unsigned char *dest, int destsz)
                        *p++ = c;
                }
 
-               if (xbuff[1] == (unsigned char)(~xbuff[2]) && 
+               if (xbuff[1] == (unsigned char)(~xbuff[2]) &&
                        (xbuff[1] == packetno || xbuff[1] == (unsigned char)packetno-1) &&
                        check(crc, &xbuff[3], bufsz)) {
                        if (xbuff[1] == packetno)       {
@@ -169,7 +166,7 @@ int xmodemReceive(unsigned char *dest, int destsz)
                        _outbyte(ACK);
                        continue;
                }
-       reject:
+reject:
                flushinput();
                _outbyte(NAK);
        }