PXE Cleanups, allow for 128 open files
authorH. Peter Anvin <hpa@zytor.com>
Mon, 25 Apr 2011 18:46:56 +0000 (11:46 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 25 Apr 2011 18:46:56 +0000 (11:46 -0700)
Clean up dead code in the PXE stack.

The buffer assignment no longer limits the number of open files
either, so raise it to something more than reasonable.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/sys/file.h
core/fs/pxe/pxe.h
core/include/fs.h

index e984f16..12518a8 100644 (file)
@@ -74,7 +74,7 @@ struct output_dev {
 
 /* File structure */
 
-#define NFILES 32              /* Number of files to support */
+#define NFILES 128             /* Number of files to support */
 #define MAXBLOCK 16384         /* Defined by ABI */
 
 struct file_info {
index 24a8642..8228def 100644 (file)
 #define PXE_H
 
 #include <syslinux/pxe_api.h>
-#include "fs.h"                        /* For MAX_OPEN, should go away */
+#include "fs.h"                        /* Mostly for FILENAME_MAX */
 
 /*
  * Some basic defines...
  */
-#define PKTBUF_SIZE     2048                   /*  */
+#define PKTBUF_SIZE     2048   /* Used mostly by the gPXE backend */
 
 #define is_digit(c)     (((c) >= '0') && ((c) <= '9'))
 
-static inline bool is_hex(char c)
-{
-    return (c >= '0' && c <= '9') ||
-       (c >= 'A' && c <= 'F') ||
-       (c >= 'a' && c <= 'f');
-}
-
-static inline int hexval(char c)
-{
-    return (c >= 'A') ? (c & ~0x20) - 'A' + 10 : (c - '0');
-}
-
 #define BOOTP_OPTION_MAGIC  htonl(0x63825363)
 #define MAC_MAX 32
 
index ecd148d..4301481 100644 (file)
 #include "disk.h"
 
 /*
- * Maximum number of open files.  This is *currently* constrained by the
- * fact that PXE needs to be able to fit all its packet buffers into a
- * 64K segment; this should be fixed by moving the packet buffers to high
- * memory.
+ * Maximum number of open files.
  */
-#define MAX_OPEN_LG2   5
+#define MAX_OPEN_LG2   7
 #define MAX_OPEN       (1 << MAX_OPEN_LG2)
 
 #define FILENAME_MAX_LG2 8