Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Fixed the bug that caused the first packet sent to always be malformed.
Matt Wojcik [Fri, 8 Aug 2008 19:57:18 +0000 (19:57 +0000)]
palacios/src/geekos/ne2k.c

index b64f9cf..8810895 100644 (file)
@@ -263,7 +263,7 @@ int NE2K_Send(uchar_t src[], uchar_t dest[], uint_t type, uchar_t *data, uint_t
 {
   struct _CR * cr = (struct _CR*)&(regs->cr);
   uint_t packet_size = size + 16;
-  regs->cr = 0x21;
+  regs->cr = 0x21; /* Turn off remote DMA, stop command */
   cr->stp = 0x0;  //toggle start on
   cr->sta = 0x1;
   Out_Byte(NE2K_CR, regs->cr);
@@ -291,7 +291,7 @@ int NE2K_Send(uchar_t src[], uchar_t dest[], uint_t type, uchar_t *data, uint_t
   Out_Byte(NE2K_RSAR0, 0x00);
   Out_Byte(NE2K_RSAR1, TX_START_BUFF);
 
-  regs->cr = 0x16;
+  cr->rd = 0x02; /* Set remote DMA to write */
   Out_Byte(NE2K_CR, regs->cr);
 
   /* Destination Address */
@@ -312,6 +312,9 @@ int NE2K_Send(uchar_t src[], uchar_t dest[], uint_t type, uchar_t *data, uint_t
     Out_Word(NE2K_CR + 0x10, (*(data + i + 1) << 8) | *(data + i));
   }
 
+  cr->txp = 0x1; /* Start transmission */
+  Out_Byte(NE2K_CR, regs->cr);
+
   return 0;
 }