From ba66e703f7ce6d4246a6c3f61cebb9ae59298ab8 Mon Sep 17 00:00:00 2001 From: AKuHAK <621640+AKuHAK@users.noreply.github.com> Date: Tue, 15 Jun 2021 12:40:56 +0300 Subject: [PATCH] Code cleanup --- CHANGELOG | 20 +- LICENSE | 2 +- README.md | 50 +-- ee_core/include/cheat_engine.h | 4 +- ee_core/include/ee_core.h | 2 +- ee_core/include/igs_api.h | 66 +-- ee_core/include/modmgr.h | 2 +- ee_core/include/modules.h | 4 +- ee_core/include/padhook.h | 12 +- ee_core/linkfile | 4 +- ee_core/src/cheat_engine.S | 2 +- ee_core/src/gsm_api.c | 4 +- ee_core/src/gsm_engine.S | 20 +- ee_core/src/gsm_engine_adv.S | 30 +- ee_core/src/patches.c | 36 +- ee_core/src/tlb.c | 4 +- elfldr/crt0.S | 2 +- include/OSDHistory.h | 6 +- include/appsupport.h | 6 +- include/cheatman.h | 12 +- include/compatupd.h | 8 +- include/config.h | 150 +++---- include/dialogs.h | 2 +- include/fntsys.h | 2 +- include/gui.h | 8 +- include/guigame.h | 2 +- include/ioman.h | 12 +- include/iosupport.h | 12 +- include/nbns.h | 2 +- include/opl.h | 14 +- include/pad.h | 30 +- include/pggsm.h | 2 +- include/renderman.h | 14 +- include/supportbase.h | 6 +- include/system.h | 4 +- include/textures.h | 10 +- labs/genvmclab/Makefile | 2 +- labs/smblab/Makefile | 2 +- misc/conf_theme_OPL.cfg | 2 +- modules/debug/ioptrap/exports.tab | 4 +- modules/debug/ioptrap/handler.S | 258 +++++------ modules/debug/ioptrap/ioptrap.h | 2 +- modules/debug/ps2link/LICENSE | 2 +- modules/debug/ps2link/hostlink.h | 116 ++--- modules/debug/ps2link/imports.lst | 1 - modules/debug/ps2link/nprintf.c | 2 +- modules/debug/udptty-ingame/imports.lst | 1 - modules/debug/udptty-ingame/udptty.c | 2 +- modules/ds34bt/Makefile | 6 +- modules/ds34bt/ee/Makefile | 2 +- modules/ds34bt/ee/libds34bt.c | 18 +- modules/ds34bt/iop/ds34bt.c | 20 +- modules/ds34bt/iop/ds34bt.h | 112 ++--- modules/ds34usb/Makefile | 6 +- modules/ds34usb/ee/Makefile | 2 +- modules/ds34usb/ee/libds34usb.c | 8 +- modules/ds34usb/iop/ds34usb.c | 10 +- modules/ds34usb/iop/ds34usb.h | 98 ++-- modules/hdd/common/opl-hdd-ioctl.h | 2 +- modules/iopcore/cdvdman/atad.c | 10 +- modules/iopcore/cdvdman/atad.h | 28 +- modules/iopcore/cdvdman/cdvdman.c | 6 +- modules/iopcore/cdvdman/dev9.c | 2 +- modules/iopcore/cdvdman/hdpro_atad.c | 36 +- modules/iopcore/cdvdman/internal.h | 2 +- modules/iopcore/cdvdman/smb.c | 10 +- modules/iopcore/cdvdman/smb.h | 418 +++++++++--------- modules/iopcore/common/cdvd_config.h | 10 +- modules/iopcore/common/cdvdman.h | 112 ++--- modules/iopcore/common/oplsmb.h | 2 +- modules/iopcore/patches/apemodpatch/main.c | 2 +- modules/iopcore/udnl-t300/include/COFF.h | 2 +- modules/iopcore/udnl-t300/include/ELF.h | 20 +- modules/iopcore/udnl-t300/udnl.c | 2 +- modules/iopcore/udnl/include/COFF.h | 2 +- modules/iopcore/udnl/include/ELF.h | 20 +- modules/iopcore/udnl/udnl.c | 2 +- modules/isofs/imports.lst | 1 - modules/mcemu/mcemu.c | 2 +- modules/mcemu/mcemu_utils.h | 2 +- modules/network/SMSTCPIP/api_msg.c | 2 +- modules/network/SMSTCPIP/etharp.c | 8 +- modules/network/SMSTCPIP/include/arch/cc.h | 2 +- .../network/SMSTCPIP/include/arch/sys_arch.h | 6 +- modules/network/SMSTCPIP/include/lwip/api.h | 16 +- .../network/SMSTCPIP/include/lwip/api_msg.h | 2 +- modules/network/SMSTCPIP/include/lwip/arch.h | 282 ++++++------ modules/network/SMSTCPIP/include/lwip/debug.h | 10 +- modules/network/SMSTCPIP/include/lwip/dhcp.h | 104 ++--- modules/network/SMSTCPIP/include/lwip/err.h | 4 +- modules/network/SMSTCPIP/include/lwip/icmp.h | 22 +- modules/network/SMSTCPIP/include/lwip/ip.h | 56 +-- .../network/SMSTCPIP/include/lwip/ip_addr.h | 38 +- modules/network/SMSTCPIP/include/lwip/netif.h | 8 +- modules/network/SMSTCPIP/include/lwip/opt.h | 48 +- modules/network/SMSTCPIP/include/lwip/pbuf.h | 8 +- .../network/SMSTCPIP/include/lwip/sockets.h | 124 +++--- modules/network/SMSTCPIP/include/lwip/sys.h | 62 +-- modules/network/SMSTCPIP/include/lwip/tcp.h | 56 ++- modules/network/SMSTCPIP/include/lwip/tcpip.h | 6 +- .../network/SMSTCPIP/include/lwip/timers.h | 21 +- modules/network/SMSTCPIP/include/lwip/udp.h | 6 +- modules/network/SMSTCPIP/include/lwipopts.h | 36 +- .../network/SMSTCPIP/include/netif/etharp.h | 2 +- modules/network/SMSTCPIP/ip.c | 3 +- modules/network/SMSTCPIP/ip_frag.c | 4 +- modules/network/SMSTCPIP/loopif.c | 2 +- modules/network/SMSTCPIP/ps2ip.c | 20 +- modules/network/SMSTCPIP/sockets.c | 4 +- modules/network/SMSTCPIP/tcp.c | 2 +- modules/network/SMSTCPIP/tcpip.c | 5 +- modules/network/SMSTCPIP/timers.c | 248 +++++------ modules/network/SMSTCPIP/udp.c | 4 +- modules/network/common/httpclient.h | 10 +- modules/network/common/smstcpip-common.h | 74 ++-- modules/network/common/smstcpip.h | 28 +- modules/network/lwnbdsvr/lwNBD/README.md | 2 +- modules/network/lwnbdsvr/lwNBD/nbd-protocol.h | 120 ++--- modules/network/lwnbdsvr/lwNBD/nbd_server.h | 2 +- modules/network/nbns/nbns.c | 16 +- modules/network/smap-ingame/main.c | 6 +- modules/network/smap-ingame/smap.c | 4 +- modules/network/smbinit/des.c | 2 +- modules/pademu/ds34bt.c | 4 +- modules/pademu/ds34bt.h | 112 ++--- modules/pademu/ds34usb.c | 2 +- modules/pademu/ds34usb.h | 98 ++-- modules/pademu/pademu.c | 20 +- modules/vmc/genvmc/genvmc.c | 4 +- modules/vmc/genvmc/genvmc.h | 6 +- pc/genvmc/Makefile | 2 +- pc/genvmc/src/genvmc.c | 38 +- pc/genvmc/src/genvmc.h | 4 +- pc/iso2opl/libcvd_license.txt | 42 +- pc/iso2opl/src/iso2opl.h | 4 +- pc/opl2iso/src/opl2iso.c | 2 +- pc/opl2iso/src/opl2iso.h | 4 +- src/dia.c | 16 +- src/fntsys.c | 4 +- src/gui.c | 10 +- src/guigame.c | 6 +- src/hdd.c | 2 +- src/hddsupport.c | 4 +- src/opl.c | 4 +- src/system.c | 14 +- src/themes.c | 8 +- 146 files changed, 1911 insertions(+), 1919 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bf83027b5..44893adfc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,7 @@ Copyright 2013, Ifcaro & jimmikaelkael Licenced under Academic Free License version 3.0 Review OpenUsbLd README & LICENSE files for further details. - + ----------------------------------------------------------------------------- === Changelog === @@ -77,7 +77,7 @@ CORE: * Merged OPL/OPLGSM codebase * GSM Core 0.36.R - don't worry; 0.38 will be coming back better than ever! -* GSM Core no longer supports 576p, 1080p, Skip FMVs - this is temporary. +* GSM Core no longer supports 576p, 1080p, Skip FMVs - this is temporary. * GSM Core is now IGR and CodeBreaker/PS2rd compatible! * GSM no longer included in Childproof builds. * Unified Makefile builds from single source tree via "GSM=0/1" argument (ala VMC/No VMC) @@ -87,32 +87,32 @@ CORE: * Added power-off processing code. Games should be able to power-off the console now. * Optimzed CDVDMAN and CDVDFSV * Support for PSX (DVR) units -* Built-in TLB reinitialization mechanism - no more EECORE hooking and patching. +* Built-in TLB reinitialization mechanism - no more EECORE hooking and patching. * Added compatibility mode 7 - "IOP Threading Hack". * Replaced SMAP driver. * Modified SMSTCPIP. * Ported a version of ETH Mode types from doctorxyz's OPLGSM. * Retired the built-in kernel update for Protokernel consoles (SCPH-10000 and SCPH-15000). -GUI: +GUI: * New "Show GSM on Main Menu" toggle in "Settings" (GSM Builds Only) * New "GSM Settings" on Main Menu - easier navigation! (GSM Builds Only) * Fixed issue with HDLSERV and GSM Settings not showing up immediately. -* Full Ethernet controls - can disable Auto-Negotiation and force a mode. +* Full Ethernet controls - can disable Auto-Negotiation and force a mode. * Some things were are worded differently as less words carry more freight. * Removed redundant UDMA modes - PS2 will never handle UDMA 5 and UDMA 6. -* Updated SMB support to give better error messages. -* Network error codes changed slightly - 300 for connection errors, 301 for logon errors, 302 for ECHO isalive +* Updated SMB support to give better error messages. +* Network error codes changed slightly - 300 for connection errors, 301 for logon errors, 302 for ECHO isalive test failing, and 303 for share opening errors. - -COMPATIBILITY: + +COMPATIBILITY: * Kingdom Hearts 2 Final Mix (Gummi Fix) * Baldar's Gate Series (HDD) * Champions of Norrath (HDD) - * New Mode 7 fixes stuttering with games such as DDR and Pop'N Music (HDD ONLY!) + * New Mode 7 fixes stuttering with games such as DDR and Pop'N Music (HDD ONLY!) ==== Version 0.9 ==== diff --git a/LICENSE b/LICENSE index 67e6afbdb..62b2577d2 100644 --- a/LICENSE +++ b/LICENSE @@ -154,7 +154,7 @@ of such entity. restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. -16) Modification of This License. This License is Copyright © 2005 Lawrence +16) Modification of This License. This License is Copyright � 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You diff --git a/README.md b/README.md index 42743333c..346680115 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Open PS2 Loader -Copyright 2013, Ifcaro & jimmikaelkael -Licenced under Academic Free License version 3.0 -Review LICENSE file for further details. +Copyright 2013, Ifcaro & jimmikaelkael +Licenced under Academic Free License version 3.0 +Review LICENSE file for further details. [![CI](https://github.com/ifcaro/Open-PS2-Loader/workflows/CI/badge.svg)](https://github.com/ifcaro/Open-PS2-Loader/actions?query=workflow%3ACI) @@ -12,12 +12,12 @@ Open PS2 Loader (OPL) is a 100% Open source game and application loader for the PS2 and PS3 units. It supports three categories of devices : USB mass storage devices, SMB shares and the PlayStation 2 HDD unit. USB devices and SMB shares support USBExtreme and \*.ISO formats while PS2 HDD supports HDLoader -format. It's now the most compatible homebrew loader. +format. It's now the most compatible homebrew loader. OPL is also developed continuously - anyone can contribute improvements to -the project due to its open source nature. +the project due to its open source nature. -You can visit the Open PS2 Loader forum at: +You can visit the Open PS2 Loader forum at: https://www.psx-place.com/forums/open-ps2-loader-opl.77/ @@ -25,14 +25,14 @@ You can report compatibility game problems at: https://www.psx-place.com/threads/open-ps2-loader-game-bug-reports.19401/ -For updated compatibility list, you can visit OPL-CL site at: +For updated compatibility list, you can visit OPL-CL site at: -http://sx.sytes.net/oplcl/games.aspx +http://sx.sytes.net/oplcl/games.aspx ## Release types Open PS2 Loader bundle included several types of the same OPL version. These -types come with more or less features included. +types come with more or less features included. | Type (can be a combination) | Description | | --------------------------- | ---------------------------------------------------------------------------------------------- | @@ -45,7 +45,7 @@ types come with more or less features included. ## How to use OPL uses the following directory tree structure across HDD, SMB, and -USB modes: +USB modes: | Folder | Description | Modes | | ------ | ----------- | ----- | @@ -60,19 +60,19 @@ USB modes: OPL will automatically create the above directory structure the first time you launch it and enable your favourite device. For HDD users, a 128Mb +OPL -partition will be created (you can enlarge it using uLaunchELF if you need to). +partition will be created (you can enlarge it using uLaunchELF if you need to). ## USB Game files on USB must be perfectly defragmented either file by file or by whole drive, and Dual Layer DVD9 images must be split to avoid the 4GB limitations of the FAT32 file system. We recommend Auslogics Disk Defrag -for best defragging results. +for best defragging results. -http://www.auslogics.com/en/software/disk-defrag/ +http://www.auslogics.com/en/software/disk-defrag/ You also need a PC program to convert or split games into USB Advance/Extreme -format, such as USBUtil 2.0. +format, such as USBUtil 2.0. ## SMB @@ -81,36 +81,36 @@ on the host machine or NAS device and make sure that it has full read and write permissions. USB Advance/Extreme format is optional - \*.ISO images are supported using the folder structure above with the added bonus that DVD9 images don't have to be split if your SMB device uses the NTFS or -EXT3/4 file system. +EXT3/4 file system. ## HDD For PS2, 48-bit LBA internal HDDs up to 2TB are supported. They have to be -formatted with either HDLoader or uLaunchELF (uLaunchELF is recommended). +formatted with either HDLoader or uLaunchELF (uLaunchELF is recommended). To launch OPL, you can use any of the existing methods for loading an -executable elf. +executable elf. ## PS3 On PS3, you need an original SwapMagic 3.6+ or 3.8 disc (at the moment -there aren't any other options). The steps for loading OPL on a PS3 are: +there aren't any other options). The steps for loading OPL on a PS3 are: 1. Rename OPNPS2LD.ELF to SMBOOT0.ELF 2. Make a folder in root of USB device called SWAPMAGIC and copy SMBOOT0.ELF to it. 3. Launch SwapMagic in PS3 and press UP+L1 then Open PS2 Loader should start. -There are 4 forms for launching elfs in SwapMagic. +There are 4 forms for launching elfs in SwapMagic. -SMBOOT0.ELF = UP + L1 -SMBOOT1.ELF = UP + L2 -SMBOOT2.ELF = UP + R1 -SMBOOT3.ELF = UP + R2 +SMBOOT0.ELF = UP + L1 +SMBOOT1.ELF = UP + L2 +SMBOOT2.ELF = UP + R1 +SMBOOT3.ELF = UP + R2 -Note: on PS3, only USB and SMB modes are supported. +Note: on PS3, only USB and SMB modes are supported. ## Some notes for devs -Open PS2 Loader needs the latest PS2SDK: +Open PS2 Loader needs the latest PS2SDK: https://github.com/ps2dev/ps2sdk diff --git a/ee_core/include/cheat_engine.h b/ee_core/include/cheat_engine.h index ba9419518..8512da359 100644 --- a/ee_core/include/cheat_engine.h +++ b/ee_core/include/cheat_engine.h @@ -24,8 +24,8 @@ #ifndef _CHEATENGINE_H_ #define _CHEATENGINE_H_ -#define MAX_HOOKS 5 -#define MAX_CODES 250 +#define MAX_HOOKS 5 +#define MAX_CODES 250 #define MAX_CHEATLIST (MAX_HOOKS * 2 + MAX_CODES * 2) extern void (*Old_SetupThread)(void *gp, void *stack, s32 stack_size, void *args, void *root_func); diff --git a/ee_core/include/ee_core.h b/ee_core/include/ee_core.h index 59d3df184..8f9d63441 100644 --- a/ee_core/include/ee_core.h +++ b/ee_core/include/ee_core.h @@ -24,7 +24,7 @@ #ifdef __EESIO_DEBUG #include #define DPRINTF(args...) sio_printf(args) -#define DINIT() sio_init(38400, 0, 0, 0, 0) +#define DINIT() sio_init(38400, 0, 0, 0, 0) #else #define DPRINTF(args...) \ do { \ diff --git a/ee_core/include/igs_api.h b/ee_core/include/igs_api.h index f4ef9bfea..ef86c48d9 100644 --- a/ee_core/include/igs_api.h +++ b/ee_core/include/igs_api.h @@ -33,30 +33,30 @@ #include #define GS_BITBLTBUF 0x50 -#define GS_TRXPOS 0x51 -#define GS_TRXREG 0x52 -#define GS_TRXDIR 0x53 -#define GS_FINISH 0x61 +#define GS_TRXPOS 0x51 +#define GS_TRXREG 0x52 +#define GS_TRXDIR 0x53 +#define GS_FINISH 0x61 //Pixel storage format -#define GS_PSM_CT32 0x00 //32 bits = 4 bytes Example: SLUS_202.73 (Namco Museum 50th Anniversary) -#define GS_PSM_CT24 0x01 //24 bits = 3 bytes Example: SLPS_250.88 (Final Fantasy X International) -#define GS_PSM_CT16 0x02 //16 bits = 2 bytes Example: SLUS_215.56 (Konami Kids Playground: Dinosaurs Shapes & Colors) +#define GS_PSM_CT32 0x00 //32 bits = 4 bytes Example: SLUS_202.73 (Namco Museum 50th Anniversary) +#define GS_PSM_CT24 0x01 //24 bits = 3 bytes Example: SLPS_250.88 (Final Fantasy X International) +#define GS_PSM_CT16 0x02 //16 bits = 2 bytes Example: SLUS_215.56 (Konami Kids Playground: Dinosaurs Shapes & Colors) #define GS_PSM_CT16S 0x0A //16 bits = 2 bytes Example: SLUS_215.41 (Ratatouille) //Channel #1 (VIF1) -#define GS_VIF1_STAT ((volatile u32 *)(0x10003c00)) // VIF Status Register -#define GS_VIF1_STAT_FDR (1 << 23) // VIF1-FIFO transfer direction: VIF1 -> Main memory/SPRAM" +#define GS_VIF1_STAT ((volatile u32 *)(0x10003c00)) // VIF Status Register +#define GS_VIF1_STAT_FDR (1 << 23) // VIF1-FIFO transfer direction: VIF1 -> Main memory/SPRAM" #define GS_VIF1_MSKPATH3(mask) ((u32)(mask) | ((u32)0x06 << 24)) -#define GS_VIF1_NOP 0 -#define GS_VIF1_FLUSHA (((u32)0x13 << 24)) -#define GS_VIF1_DIRECT(count) ((u32)(count) | ((u32)(0x50) << 24)) -#define GS_VIF1_FIFO ((volatile u128 *)(0x10005000)) +#define GS_VIF1_NOP 0 +#define GS_VIF1_FLUSHA (((u32)0x13 << 24)) +#define GS_VIF1_DIRECT(count) ((u32)(count) | ((u32)(0x50) << 24)) +#define GS_VIF1_FIFO ((volatile u128 *)(0x10005000)) //DMA CH1 REGISTERS (Linked to VIF1) #define GS_D1_CHCR ((volatile u32 *)(0x10009000)) #define GS_D1_MADR ((volatile u32 *)(0x10009010)) -#define GS_D1_QWC ((volatile u32 *)(0x10009020)) +#define GS_D1_QWC ((volatile u32 *)(0x10009020)) #define GS_D1_TADR ((volatile u32 *)(0x10009030)) #define GS_D1_ASR0 ((volatile u32 *)(0x10009040)) #define GS_D1_ASR1 ((volatile u32 *)(0x10009050)) @@ -89,29 +89,29 @@ #define GS_GSTRXDIR_SET(xdr) ((u64)(xdr)) #define GS_GSBITBLTBUF 0x50 -#define GS_GSFINISH 0x61 -#define GS_GSTRXPOS 0x51 -#define GS_GSTRXREG 0x52 -#define GS_GSTRXDIR 0x53 +#define GS_GSFINISH 0x61 +#define GS_GSTRXPOS 0x51 +#define GS_GSTRXREG 0x52 +#define GS_GSTRXDIR 0x53 //GS Priviledge Registers #define GS_CSR_FINISH (1 << 1) -#define GS_CSR (volatile u64 *)0x12001000 // GS CSR (GS System Status) Register -#define GS_IMR (volatile u64 *)0x12001010 // GS IMR (GS Interrupt Mask) Register -#define GS_BUSDIR (volatile u64 *)0x12001040 // GS BUSDIR (GS Bus Direction) Register - -#define GET_PMODE_EN1(x) (u8)((x >> 0) & 0x1) -#define GET_PMODE_EN2(x) (u8)((x >> 1) & 0x1) -#define GET_SMODE2_INT(x) (u8)((x >> 0) & 0x1) -#define GET_SMODE2_FFMD(x) (u8)((x >> 1) & 0x1) -#define GET_SMODE2_DPMS(x) (u8)((x >> 2) & 0x3) +#define GS_CSR (volatile u64 *)0x12001000 // GS CSR (GS System Status) Register +#define GS_IMR (volatile u64 *)0x12001010 // GS IMR (GS Interrupt Mask) Register +#define GS_BUSDIR (volatile u64 *)0x12001040 // GS BUSDIR (GS Bus Direction) Register + +#define GET_PMODE_EN1(x) (u8)((x >> 0) & 0x1) +#define GET_PMODE_EN2(x) (u8)((x >> 1) & 0x1) +#define GET_SMODE2_INT(x) (u8)((x >> 0) & 0x1) +#define GET_SMODE2_FFMD(x) (u8)((x >> 1) & 0x1) +#define GET_SMODE2_DPMS(x) (u8)((x >> 2) & 0x3) #define GET_SMODE2_INTFFMD(x) (u8)((x >> 0) & 0x3) -#define GET_DISPFB_FBP(x) (u16)((x >> 0) & 0x1FF) -#define GET_DISPFB_FBW(x) (u8)((x >> 9) & 0x3F) -#define GET_DISPFB_PSM(x) (u8)((x >> 15) & 0x1F) -#define GET_DISPFB_DBX(x) (u16)((x >> 32) & 0x7FF) -#define GET_DISPFB_DBY(x) (u16)((x >> 43) & 0x7FF) -#define GET_DISPLAY_DH(x) (u16)((x >> 44) & 0x7FF) +#define GET_DISPFB_FBP(x) (u16)((x >> 0) & 0x1FF) +#define GET_DISPFB_FBW(x) (u8)((x >> 9) & 0x3F) +#define GET_DISPFB_PSM(x) (u8)((x >> 15) & 0x1F) +#define GET_DISPFB_DBX(x) (u16)((x >> 32) & 0x7FF) +#define GET_DISPFB_DBY(x) (u16)((x >> 43) & 0x7FF) +#define GET_DISPLAY_DH(x) (u16)((x >> 44) & 0x7FF) #define GS_WRITEBACK_DCACHE 0 diff --git a/ee_core/include/modmgr.h b/ee_core/include/modmgr.h index 5190c208c..325658244 100644 --- a/ee_core/include/modmgr.h +++ b/ee_core/include/modmgr.h @@ -11,7 +11,7 @@ #define MODMGR_H #define LF_PATH_MAX 252 -#define LF_ARG_MAX 252 +#define LF_ARG_MAX 252 enum _lf_functions { LF_F_MOD_LOAD = 0, diff --git a/ee_core/include/modules.h b/ee_core/include/modules.h index 5c5a75f13..897216e65 100644 --- a/ee_core/include/modules.h +++ b/ee_core/include/modules.h @@ -48,6 +48,6 @@ typedef struct } irxtab_t; //Macros for working with module information. -#define GET_OPL_MOD_ID(x) ((x) >> 24) -#define SET_OPL_MOD_ID(x) ((x) << 24) +#define GET_OPL_MOD_ID(x) ((x) >> 24) +#define SET_OPL_MOD_ID(x) ((x) << 24) #define GET_OPL_MOD_SIZE(x) ((x)&0x00FFFFFF) diff --git a/ee_core/include/padhook.h b/ee_core/include/padhook.h index e60a5d8ed..88bb745e4 100644 --- a/ee_core/include/padhook.h +++ b/ee_core/include/padhook.h @@ -16,7 +16,7 @@ #include -#define PADOPEN_HOOK 0 +#define PADOPEN_HOOK 0 #define PADOPEN_CHECK 1 int Install_PadOpen_Hook(u32 mem_start, u32 mem_end, int mode); @@ -80,16 +80,16 @@ typedef struct } pattern_t; #define IGR_LIBPAD_NONE 0 //libpad not found -#define IGR_LIBPAD 1 -#define IGR_LIBPAD2 2 +#define IGR_LIBPAD 1 +#define IGR_LIBPAD2 2 #define IGR_PAD_STABLE_V1 0x06 #define IGR_PAD_STABLE_V2 0x01 -#define IGR_COMBO_R1_L1_R2_L2 0xF0 +#define IGR_COMBO_R1_L1_R2_L2 0xF0 #define IGR_COMBO_START_SELECT 0xF6 -#define IGR_COMBO_R3_L3 0xF9 -#define IGR_COMBO_UP 0xEF +#define IGR_COMBO_R3_L3 0xF9 +#define IGR_COMBO_UP 0xEF #define NB_PADOPEN_PATTERN 7 diff --git a/ee_core/linkfile b/ee_core/linkfile index d1b0f1157..4d556bc3f 100644 --- a/ee_core/linkfile +++ b/ee_core/linkfile @@ -3,11 +3,11 @@ Copyright 2006-2008 Polo Licenced under Academic Free License version 3.0 Review OPNPS2LD README & LICENSE files for further details. - + Copyright 2001-2004, ps2dev - http://www.ps2dev.org Licenced under Academic Free License version 2.0 Review ps2sdk README & LICENSE files for further details. - + Standard linkfile */ diff --git a/ee_core/src/cheat_engine.S b/ee_core/src/cheat_engine.S index bcf769d3c..64f0aaa2b 100644 --- a/ee_core/src/cheat_engine.S +++ b/ee_core/src/cheat_engine.S @@ -594,7 +594,7 @@ HookSetupThread: /* jump to original SetupThread() */ lw $t1, Old_SetupThread # $t1 -> original SetupThread function j $t1 - nop + nop .end HookSetupThread /******************************************************************************* diff --git a/ee_core/src/gsm_api.c b/ee_core/src/gsm_api.c index d2698e23b..2052ca115 100644 --- a/ee_core/src/gsm_api.c +++ b/ee_core/src/gsm_api.c @@ -19,7 +19,7 @@ #include "dve_reg.h" #define MAKE_J(func) (u32)((0x02 << 26) | (((u32)func) / 4)) // Jump (MIPS instruction) -#define NOP 0x00000000 // No Operation (MIPS instruction) +#define NOP 0x00000000 // No Operation (MIPS instruction) extern void (*Old_SetGsCrt)(short int interlace, short int mode, short int ffmd); @@ -27,7 +27,7 @@ extern void (*Old_SetGsCrt)(short int interlace, short int mode, short int ffmd) // NTSC #define GS_MODE_NTSC 0x02 // PAL -#define GS_MODE_PAL 0x03 +#define GS_MODE_PAL 0x03 struct GSMDestSetGsCrt { diff --git a/ee_core/src/gsm_engine.S b/ee_core/src/gsm_engine.S index e5fd19e3e..f402ba9aa 100644 --- a/ee_core/src/gsm_engine.S +++ b/ee_core/src/gsm_engine.S @@ -163,7 +163,7 @@ sync.l # Wait for any outstanding stores to registers to complete before ca // //This function will get called first, in place of the original SetGsCrt() syscall handler. It will check the video mode argument. -//If it's one of the extended video modes, do not call the original SetGsCrt() syscall handler, +//If it's one of the extended video modes, do not call the original SetGsCrt() syscall handler, //but handle GS configuration on our own. //Otherwise, call the original SetGsCrt() syscall handler and let it configure the GS for us. // @@ -196,7 +196,7 @@ nop Skip_Call_Original_SetGsCrt: //Re-enable GSHandler whenever Hook_SetGsCrt is called -//This aggressive approach is needed for those titles which disable breakpoints +//This aggressive approach is needed for those titles which disable breakpoints //For instance: UP (SLUS 21864) //----------------------------------------------------------------------------------------- @@ -205,7 +205,7 @@ nop //----------------------------------------------------------------------------------------- -ld $ra, 0($sp) # Pull return address from stack +ld $ra, 0($sp) # Pull return address from stack jr $ra # Return to caller addiu $sp, $sp, 0x0010 # Restore sp during return @@ -508,7 +508,7 @@ or $v0,$zero,$a1 # go use Source_PMODE store_v0_as_PMODE: b exit_GSHandler # Now go exit -sd $v0,0($a3) # after storing +sd $v0,0($a3) # after storing # ---------------------------- # SMODE2 @@ -572,7 +572,7 @@ sd $v0,0($a3) # after storing # ---------------------------- # DISPLAY1 -# +# have_DISPLAY1_write: # Here a1=source_data, a2->.gsm_engine, a3=dest_adress sd $a1, Source_DISPLAY1($s0) # request DISPLAY1 value = a1 @@ -591,7 +591,7 @@ sd $v0,0($a3) # after storing # ---------------------------- # DISPLAY2 -# +# have_DISPLAY2_write: # Here a1=source_data, a2->.gsm_engine, a3=dest_adress sd $a1, Source_DISPLAY2($s0) # request DISPLAY2 value = a1 @@ -610,7 +610,7 @@ sd $v0,0($a3) # after storing # ---------------------------- # DISPLAYx -# +# have_DISPLAY_write: # Here a1=source_data, a2->.gsm_engine, a3=dest_adress # Source_DISPLAY == Requested DX, DY, MAGH, MAGV, DW and DH values # Target_DISPLAY == Modded(forced) DX, DY, MAGH, MAGV, DW and DH values @@ -818,7 +818,7 @@ or $v0,$v0,$t0 # v0 = Adapted_DISPLAY = (Adapted_DISPLAY) OR (Calculated_ # ---------------------------- # DISPFBx -# +# # .-------.-------.------------.----------------------------------------------.-------. # | Name | Pos. | Format | Contents | Mask | # |-------+-------+------------+----------------------------------------------+-------+ @@ -987,7 +987,7 @@ nop li $t0,0xFC1FFFFF # t0 = bitmask for JR and $k1,$k0, $t0 # k1 = potential JR instruction li $t0,8 # t0 = JR test constant -bne $k1,$t0,B_skip # in case of JR not identified, go skip this code +bne $k1,$t0,B_skip # in case of JR not identified, go skip this code nop B_JR_JALR: # JR or JALR found, so make register indirect jump @@ -1061,7 +1061,7 @@ mtc0 $k0,$30 # store k0 in Error Exception Program Counter sync.p # ensure COP0 register update before proceeding. This cannot be placed in a branch-delay slot. b GSHandler_Final_Exit nop - + # ---------------------------- B_BGEZ: B_BGEZAL: diff --git a/ee_core/src/gsm_engine_adv.S b/ee_core/src/gsm_engine_adv.S index 36e1ba307..de2dac195 100644 --- a/ee_core/src/gsm_engine_adv.S +++ b/ee_core/src/gsm_engine_adv.S @@ -214,21 +214,21 @@ sd $v0,0($a3) # after storing # ^-----^---^---------^-----------------------------------------------------. # Reference Table # SRFSH SPML -# NTSC-NI (640x240(224)) 8 4 -# NTSC-I (640x480(448)) 8 4 -# PAL-NI (640x288(256)) 8 4 -# PAL-I (640x576(512)) 8 4 -# VESA-1A (640x480 59.940Hz) 4 2 -# VESA-1C (640x480 75.000Hz) 4 2 -# VESA-2B (800x600 60.317Hz) 4 2 -# VESA-2D (800x600 75.000Hz) 4 2 -# VESA-3B (1024x768 60.004Hz) 4 2 -# VESA-3D (1024x768 75.029Hz) 2 1 -# VESA-4A (1280x1024 60.020Hz) 2 1 -# VESA-4B (1280x1024 75.025Hz) 2 1 -# DTV-480P (720x480) 4 2 -# DTV-1080I (1920x1080) 4 1 -# DTV-720P (1280x720) 4 1 +# NTSC-NI (640x240(224)) 8 4 +# NTSC-I (640x480(448)) 8 4 +# PAL-NI (640x288(256)) 8 4 +# PAL-I (640x576(512)) 8 4 +# VESA-1A (640x480 59.940Hz) 4 2 +# VESA-1C (640x480 75.000Hz) 4 2 +# VESA-2B (800x600 60.317Hz) 4 2 +# VESA-2D (800x600 75.000Hz) 4 2 +# VESA-3B (1024x768 60.004Hz) 4 2 +# VESA-3D (1024x768 75.029Hz) 2 1 +# VESA-4A (1280x1024 60.020Hz) 2 1 +# VESA-4B (1280x1024 75.025Hz) 2 1 +# DTV-480P (720x480) 4 2 +# DTV-1080I (1920x1080) 4 1 +# DTV-720P (1280x720) 4 1 # have_SRFSH_write: sd $a1, Source_SRFSH($s0) # Source_SRFSH = a1 diff --git a/ee_core/src/patches.c b/ee_core/src/patches.c index d79bb2a3e..290e14826 100644 --- a/ee_core/src/patches.c +++ b/ee_core/src/patches.c @@ -31,22 +31,22 @@ typedef struct } patchlist_t; //Keep patch codes unique! -#define PATCH_GENERIC_NIS 0xDEADBEE0 -#define PATCH_GENERIC_CAPCOM 0xBABECAFE -#define PATCH_GENERIC_AC9B 0xDEADBEE1 +#define PATCH_GENERIC_NIS 0xDEADBEE0 +#define PATCH_GENERIC_CAPCOM 0xBABECAFE +#define PATCH_GENERIC_AC9B 0xDEADBEE1 #define PATCH_GENERIC_SLOW_READS 0xDEADBEE2 -#define PATCH_VIRTUA_QUEST 0xDEADBEE3 -#define PATCH_SDF_MACROSS 0x00065405 -#define PATCH_SRW_IMPACT 0x0021e808 -#define PATCH_RNC_UYA 0x00398498 -#define PATCH_ZOMBIE_ZONE 0xEEE62525 -#define PATCH_DOT_HACK 0x0D074A37 -#define PATCH_SOS 0x30303030 -#define PATCH_ULT_PRO_PINBALL 0xBA11BA11 -#define PATCH_EUTECHNYX_WU_TID 0x0012FCC8 -#define PATCH_PRO_SNOWBOARDER 0x01020199 -#define PATCH_SHADOW_MAN_2 0x01020413 -#define PATCH_HARVEST_MOON_AWL 0xFF025421 +#define PATCH_VIRTUA_QUEST 0xDEADBEE3 +#define PATCH_SDF_MACROSS 0x00065405 +#define PATCH_SRW_IMPACT 0x0021e808 +#define PATCH_RNC_UYA 0x00398498 +#define PATCH_ZOMBIE_ZONE 0xEEE62525 +#define PATCH_DOT_HACK 0x0D074A37 +#define PATCH_SOS 0x30303030 +#define PATCH_ULT_PRO_PINBALL 0xBA11BA11 +#define PATCH_EUTECHNYX_WU_TID 0x0012FCC8 +#define PATCH_PRO_SNOWBOARDER 0x01020199 +#define PATCH_SHADOW_MAN_2 0x01020413 +#define PATCH_HARVEST_MOON_AWL 0xFF025421 static const patchlist_t patch_list[] = { {"SLES_524.58", BDM_MODE, {PATCH_GENERIC_NIS, 0x00000000, 0x00000000}}, // Disgaea Hour of Darkness PAL - disable cdvd timeout stuff @@ -135,9 +135,9 @@ static const patchlist_t patch_list[] = { {NULL, 0, {0x00000000, 0x00000000, 0x00000000}} // terminater }; -#define JAL(addr) (0x0c000000 | (((addr)&0x03ffffff) >> 2)) -#define JMP(addr) (0x08000000 | (0x3ffffff & ((addr) >> 2))) -#define FNADDR(jal) (((jal)&0x03ffffff) << 2) +#define JAL(addr) (0x0c000000 | (((addr)&0x03ffffff) >> 2)) +#define JMP(addr) (0x08000000 | (0x3ffffff & ((addr) >> 2))) +#define FNADDR(jal) (((jal)&0x03ffffff) << 2) #define NIBBLE2CHAR(n) ((n) <= 9 ? '0' + (n) : 'a' + (n)) static int (*cdRead)(u32 lsn, u32 nsectors, void *buf, int *mode); diff --git a/ee_core/src/tlb.c b/ee_core/src/tlb.c index de95c42d2..5c5027e87 100644 --- a/ee_core/src/tlb.c +++ b/ee_core/src/tlb.c @@ -56,8 +56,8 @@ struct TLBInfo const struct TLBEntry *extendedTLB; }; -#define TLB_NUM_KERNEL_ENTRIES 0x0D -#define TLB_NUM_DEFAULT_ENTRIES 0x12 +#define TLB_NUM_KERNEL_ENTRIES 0x0D +#define TLB_NUM_DEFAULT_ENTRIES 0x12 #define TLB_NUM_EXTENDED_ENTRIES 0x08 //Compile-time sanity checks. diff --git a/elfldr/crt0.S b/elfldr/crt0.S index 511d8d623..77963983c 100644 --- a/elfldr/crt0.S +++ b/elfldr/crt0.S @@ -21,7 +21,7 @@ .extern _heap_size .extern _stack - .extern _stack_size + .extern _stack_size .set noat .set noreorder diff --git a/include/OSDHistory.h b/include/OSDHistory.h index 945485a55..b8c69882c 100644 --- a/include/OSDHistory.h +++ b/include/OSDHistory.h @@ -81,9 +81,9 @@ Note: Year is since year 2000. */ -#define OSD_HISTORY_GET_YEAR(datestamp) ((datestamp) >> 9 & 0x7F) -#define OSD_HISTORY_GET_MONTH(datestamp) ((datestamp) >> 5 & 0xF) -#define OSD_HISTORY_GET_DATE(datestamp) ((datestamp)&0x1F) +#define OSD_HISTORY_GET_YEAR(datestamp) ((datestamp) >> 9 & 0x7F) +#define OSD_HISTORY_GET_MONTH(datestamp) ((datestamp) >> 5 & 0xF) +#define OSD_HISTORY_GET_DATE(datestamp) ((datestamp)&0x1F) #define OSD_HISTORY_SET_DATE(year, month, date) (((unsigned short int)(year)) << 9 | ((unsigned short int)(month)&0xF) << 5 | ((date)&0x1F)) struct HistoryEntry diff --git a/include/appsupport.h b/include/appsupport.h index db8e53f36..d4bd795be 100644 --- a/include/appsupport.h +++ b/include/appsupport.h @@ -6,11 +6,11 @@ #define APP_MODE_UPDATE_DELAY 240 #define APP_TITLE_MAX 128 -#define APP_PATH_MAX 128 -#define APP_BOOT_MAX 64 +#define APP_PATH_MAX 128 +#define APP_BOOT_MAX 64 #define APP_CONFIG_TITLE "title" -#define APP_CONFIG_BOOT "boot" +#define APP_CONFIG_BOOT "boot" #define APP_TITLE_CONFIG_FILE "title.cfg" diff --git a/include/cheatman.h b/include/cheatman.h index 068f2275d..5a3b99ec5 100644 --- a/include/cheatman.h +++ b/include/cheatman.h @@ -36,15 +36,15 @@ #define CHEAT_VERSION "0.5.3.65.g774d1" -#define MAX_HOOKS 5 -#define MAX_CODES 250 +#define MAX_HOOKS 5 +#define MAX_CODES 250 #define MAX_CHEATLIST (MAX_HOOKS * 2 + MAX_CODES * 2) /* Some character defines */ -#define NUL 0x00 -#define LF 0x0A -#define CR 0x0D -#define SPACE 0x20 +#define NUL 0x00 +#define LF 0x0A +#define CR 0x0D +#define SPACE 0x20 /* Number of digits per cheat code */ #define CODE_DIGITS 16 diff --git a/include/compatupd.h b/include/compatupd.h index 46baaf346..3f9aff765 100644 --- a/include/compatupd.h +++ b/include/compatupd.h @@ -1,11 +1,11 @@ #ifndef __COMPATUPD_H #define __COMPATUPD_H -#define OPL_USER_AGENT "OPL/" OPL_VERSION -#define OPL_COMPAT_HTTP_HOST "sx.sytes.net" -#define OPL_COMPAT_HTTP_PORT 80 +#define OPL_USER_AGENT "OPL/" OPL_VERSION +#define OPL_COMPAT_HTTP_HOST "sx.sytes.net" +#define OPL_COMPAT_HTTP_PORT 80 #define OPL_COMPAT_HTTP_RETRIES 3 -#define OPL_COMPAT_HTTP_URI "/oplcl/sync.ashx?code=%s&device=%d" +#define OPL_COMPAT_HTTP_URI "/oplcl/sync.ashx?code=%s&device=%d" void oplUpdateGameCompat(int UpdateAll); int oplGetUpdateGameCompatStatus(unsigned int *done, unsigned int *total); diff --git a/include/config.h b/include/config.h index d7f26d177..ff5411930 100644 --- a/include/config.h +++ b/include/config.h @@ -13,103 +13,103 @@ enum CONFIG_INDEX { }; //Config type bits -#define CONFIG_OPL (1 << CONFIG_INDEX_OPL) -#define CONFIG_LAST (1 << CONFIG_INDEX_LAST) -#define CONFIG_APPS (1 << CONFIG_INDEX_APPS) +#define CONFIG_OPL (1 << CONFIG_INDEX_OPL) +#define CONFIG_LAST (1 << CONFIG_INDEX_LAST) +#define CONFIG_APPS (1 << CONFIG_INDEX_APPS) #define CONFIG_NETWORK (1 << CONFIG_INDEX_NETWORK) -#define CONFIG_GAME (1 << CONFIG_INDEX_GAME) -#define CONFIG_ALL 0xFF +#define CONFIG_GAME (1 << CONFIG_INDEX_GAME) +#define CONFIG_ALL 0xFF #define CONFIG_SOURCE_DEFAULT 0 -#define CONFIG_SOURCE_USER 1 -#define CONFIG_SOURCE_DLOAD 2 //Downloaded from the network +#define CONFIG_SOURCE_USER 1 +#define CONFIG_SOURCE_DLOAD 2 //Downloaded from the network //Items for per-game config files. -#define CONFIG_ITEM_NAME "#Name" -#define CONFIG_ITEM_LONGNAME "#LongName" -#define CONFIG_ITEM_SIZE "#Size" -#define CONFIG_ITEM_FORMAT "#Format" -#define CONFIG_ITEM_MEDIA "#Media" -#define CONFIG_ITEM_STARTUP "#Startup" -#define CONFIG_ITEM_ALTSTARTUP "$AltStartup" -#define CONFIG_ITEM_VMC "$VMC" -#define CONFIG_ITEM_COMPAT "$Compatibility" -#define CONFIG_ITEM_DMA "$DMA" -#define CONFIG_ITEM_DNAS "$DNAS" +#define CONFIG_ITEM_NAME "#Name" +#define CONFIG_ITEM_LONGNAME "#LongName" +#define CONFIG_ITEM_SIZE "#Size" +#define CONFIG_ITEM_FORMAT "#Format" +#define CONFIG_ITEM_MEDIA "#Media" +#define CONFIG_ITEM_STARTUP "#Startup" +#define CONFIG_ITEM_ALTSTARTUP "$AltStartup" +#define CONFIG_ITEM_VMC "$VMC" +#define CONFIG_ITEM_COMPAT "$Compatibility" +#define CONFIG_ITEM_DMA "$DMA" +#define CONFIG_ITEM_DNAS "$DNAS" #define CONFIG_ITEM_CONFIGSOURCE "$ConfigSource" //Per-Game GSM keys. -Bat- -#define CONFIG_ITEM_GSMSOURCE "$GSMSource" -#define CONFIG_ITEM_ENABLEGSM "$EnableGSM" -#define CONFIG_ITEM_GSMVMODE "$GSMVMode" -#define CONFIG_ITEM_GSMXOFFSET "$GSMXOffset" -#define CONFIG_ITEM_GSMYOFFSET "$GSMYOffset" +#define CONFIG_ITEM_GSMSOURCE "$GSMSource" +#define CONFIG_ITEM_ENABLEGSM "$EnableGSM" +#define CONFIG_ITEM_GSMVMODE "$GSMVMode" +#define CONFIG_ITEM_GSMXOFFSET "$GSMXOffset" +#define CONFIG_ITEM_GSMYOFFSET "$GSMYOffset" #define CONFIG_ITEM_GSMFIELDFIX "$GSMFIELDFix" //Per-Game CHEAT keys. -Bat- #define CONFIG_ITEM_CHEATSSOURCE "$CheatsSource" -#define CONFIG_ITEM_ENABLECHEAT "$EnableCheat" -#define CONFIG_ITEM_CHEATMODE "$CheatMode" +#define CONFIG_ITEM_ENABLECHEAT "$EnableCheat" +#define CONFIG_ITEM_CHEATMODE "$CheatMode" -#define CONFIG_ITEM_PADEMUSOURCE "$PADEMUSource" -#define CONFIG_ITEM_ENABLEPADEMU "$EnablePadEmu" +#define CONFIG_ITEM_PADEMUSOURCE "$PADEMUSource" +#define CONFIG_ITEM_ENABLEPADEMU "$EnablePadEmu" #define CONFIG_ITEM_PADEMUSETTINGS "$PadEmuSettings" //OPL config keys -#define CONFIG_OPL_THEME "theme" -#define CONFIG_OPL_LANGUAGE "language_text" -#define CONFIG_OPL_SCROLLING "scrolling" -#define CONFIG_OPL_BGCOLOR "bg_color" -#define CONFIG_OPL_TEXTCOLOR "text_color" -#define CONFIG_OPL_UI_TEXTCOLOR "ui_text_color" -#define CONFIG_OPL_SEL_TEXTCOLOR "sel_text_color" +#define CONFIG_OPL_THEME "theme" +#define CONFIG_OPL_LANGUAGE "language_text" +#define CONFIG_OPL_SCROLLING "scrolling" +#define CONFIG_OPL_BGCOLOR "bg_color" +#define CONFIG_OPL_TEXTCOLOR "text_color" +#define CONFIG_OPL_UI_TEXTCOLOR "ui_text_color" +#define CONFIG_OPL_SEL_TEXTCOLOR "sel_text_color" #define CONFIG_OPL_ENABLE_NOTIFICATIONS "enable_notifications" -#define CONFIG_OPL_ENABLE_COVERART "enable_coverart" -#define CONFIG_OPL_WIDESCREEN "wide_screen" -#define CONFIG_OPL_VMODE "vmode" -#define CONFIG_OPL_XOFF "xoff" -#define CONFIG_OPL_YOFF "yoff" -#define CONFIG_OPL_OVERSCAN "overscan" -#define CONFIG_OPL_DISABLE_DEBUG "disable_debug" -#define CONFIG_OPL_PS2LOGO "ps2logo" -#define CONFIG_OPL_HDD_GAME_LIST_CACHE "hdd_game_list_cache" -#define CONFIG_OPL_EXIT_PATH "exit_path" -#define CONFIG_OPL_AUTO_SORT "autosort" -#define CONFIG_OPL_AUTO_REFRESH "autorefresh" -#define CONFIG_OPL_DEFAULT_DEVICE "default_device" -#define CONFIG_OPL_ENABLE_WRITE "enable_delete_rename" -#define CONFIG_OPL_HDD_SPINDOWN "hdd_spindown" -#define CONFIG_OPL_BDM_PREFIX "usb_prefix" // Leave this "usb" for compatibility -#define CONFIG_OPL_ETH_PREFIX "eth_prefix" -#define CONFIG_OPL_REMEMBER_LAST "remember_last" -#define CONFIG_OPL_AUTOSTART_LAST "autostart_last" -#define CONFIG_OPL_BDM_MODE "usb_mode" // Leave this "usb" for compatibility -#define CONFIG_OPL_HDD_MODE "hdd_mode" -#define CONFIG_OPL_ETH_MODE "eth_mode" -#define CONFIG_OPL_APP_MODE "app_mode" -#define CONFIG_OPL_SWAP_SEL_BUTTON "swap_select_btn" -#define CONFIG_OPL_PARENTAL_LOCK_PWD "parental_lock_password" -#define CONFIG_OPL_SFX "enable_sfx" -#define CONFIG_OPL_BOOT_SND "enable_boot_snd" -#define CONFIG_OPL_SFX_VOLUME "sfx_volume" -#define CONFIG_OPL_BOOT_SND_VOLUME "boot_snd_volume" +#define CONFIG_OPL_ENABLE_COVERART "enable_coverart" +#define CONFIG_OPL_WIDESCREEN "wide_screen" +#define CONFIG_OPL_VMODE "vmode" +#define CONFIG_OPL_XOFF "xoff" +#define CONFIG_OPL_YOFF "yoff" +#define CONFIG_OPL_OVERSCAN "overscan" +#define CONFIG_OPL_DISABLE_DEBUG "disable_debug" +#define CONFIG_OPL_PS2LOGO "ps2logo" +#define CONFIG_OPL_HDD_GAME_LIST_CACHE "hdd_game_list_cache" +#define CONFIG_OPL_EXIT_PATH "exit_path" +#define CONFIG_OPL_AUTO_SORT "autosort" +#define CONFIG_OPL_AUTO_REFRESH "autorefresh" +#define CONFIG_OPL_DEFAULT_DEVICE "default_device" +#define CONFIG_OPL_ENABLE_WRITE "enable_delete_rename" +#define CONFIG_OPL_HDD_SPINDOWN "hdd_spindown" +#define CONFIG_OPL_BDM_PREFIX "usb_prefix" // Leave this "usb" for compatibility +#define CONFIG_OPL_ETH_PREFIX "eth_prefix" +#define CONFIG_OPL_REMEMBER_LAST "remember_last" +#define CONFIG_OPL_AUTOSTART_LAST "autostart_last" +#define CONFIG_OPL_BDM_MODE "usb_mode" // Leave this "usb" for compatibility +#define CONFIG_OPL_HDD_MODE "hdd_mode" +#define CONFIG_OPL_ETH_MODE "eth_mode" +#define CONFIG_OPL_APP_MODE "app_mode" +#define CONFIG_OPL_SWAP_SEL_BUTTON "swap_select_btn" +#define CONFIG_OPL_PARENTAL_LOCK_PWD "parental_lock_password" +#define CONFIG_OPL_SFX "enable_sfx" +#define CONFIG_OPL_BOOT_SND "enable_boot_snd" +#define CONFIG_OPL_SFX_VOLUME "sfx_volume" +#define CONFIG_OPL_BOOT_SND_VOLUME "boot_snd_volume" //Network config keys -#define CONFIG_NET_ETH_LINKM "eth_linkmode" -#define CONFIG_NET_PS2_DHCP "ps2_ip_use_dhcp" -#define CONFIG_NET_PS2_IP "ps2_ip_addr" -#define CONFIG_NET_PS2_NETM "ps2_netmask" -#define CONFIG_NET_PS2_GATEW "ps2_gateway" -#define CONFIG_NET_PS2_DNS "ps2_dns" +#define CONFIG_NET_ETH_LINKM "eth_linkmode" +#define CONFIG_NET_PS2_DHCP "ps2_ip_use_dhcp" +#define CONFIG_NET_PS2_IP "ps2_ip_addr" +#define CONFIG_NET_PS2_NETM "ps2_netmask" +#define CONFIG_NET_PS2_GATEW "ps2_gateway" +#define CONFIG_NET_PS2_DNS "ps2_dns" #define CONFIG_NET_SMB_NB_ADDR "smb_share_nb_addr" #define CONFIG_NET_SMB_IP_ADDR "smb_ip" -#define CONFIG_NET_SMB_NBNS "smb_share_use_nbns" -#define CONFIG_NET_SMB_SHARE "smb_share" -#define CONFIG_NET_SMB_USER "smb_user" -#define CONFIG_NET_SMB_PASSW "smb_pass" -#define CONFIG_NET_SMB_PORT "smb_port" +#define CONFIG_NET_SMB_NBNS "smb_share_use_nbns" +#define CONFIG_NET_SMB_SHARE "smb_share" +#define CONFIG_NET_SMB_USER "smb_user" +#define CONFIG_NET_SMB_PASSW "smb_pass" +#define CONFIG_NET_SMB_PORT "smb_port" -#define CONFIG_KEY_NAME_LEN 32 +#define CONFIG_KEY_NAME_LEN 32 #define CONFIG_KEY_VALUE_LEN 256 struct config_value_t diff --git a/include/dialogs.h b/include/dialogs.h index 034778394..e672312ab 100644 --- a/include/dialogs.h +++ b/include/dialogs.h @@ -163,7 +163,7 @@ enum UI_ITEMS { #endif }; -#define COMPAT_NOEXIT 0x70000000 +#define COMPAT_NOEXIT 0x70000000 #define COMPAT_LOADFROMDISC (COMPAT_LOADFROMDISC_ID | COMPAT_NOEXIT) #define COMPAT_VMC1_ACTION (COMPAT_VMC1_ACTION_ID | COMPAT_NOEXIT) diff --git a/include/fntsys.h b/include/fntsys.h index 81184aa43..2eaf2c9a6 100644 --- a/include/fntsys.h +++ b/include/fntsys.h @@ -6,7 +6,7 @@ /// default (built-in) font id #define FNT_DEFAULT (0) /// Value returned on errors -#define FNT_ERROR (-1) +#define FNT_ERROR (-1) /** Initializes the font subsystem */ void fntInit(); diff --git a/include/gui.h b/include/gui.h index c02f73939..71fc30114 100644 --- a/include/gui.h +++ b/include/gui.h @@ -53,11 +53,11 @@ typedef void (*gui_callback_t)(void); extern int guiInactiveFrames; extern int guiFrameId; -#define GUI_SCREEN_MAIN 0 -#define GUI_SCREEN_MENU 1 -#define GUI_SCREEN_INFO 2 +#define GUI_SCREEN_MAIN 0 +#define GUI_SCREEN_MENU 1 +#define GUI_SCREEN_INFO 2 #define GUI_SCREEN_GAME_MENU 3 -#define GUI_SCREEN_APP_MENU 4 +#define GUI_SCREEN_APP_MENU 4 void guiSwitchScreen(int target); diff --git a/include/guigame.h b/include/guigame.h index a59f47133..a9daf5118 100644 --- a/include/guigame.h +++ b/include/guigame.h @@ -1,7 +1,7 @@ #ifndef __GUIGAME_H #define __GUIGAME_H -#define SETTINGS_GLOBAL 0 +#define SETTINGS_GLOBAL 0 #define SETTINGS_PERGAME 1 int guiGameAltStartupNameHandler(char *text, int maxLen); diff --git a/include/ioman.h b/include/ioman.h index a6d88290d..15a9d4f01 100644 --- a/include/ioman.h +++ b/include/ioman.h @@ -4,12 +4,12 @@ // Input output manager // asynchronous io handling thread with worker queue -#define IO_OK 0 +#define IO_OK 0 #define IO_ERR_UNKNOWN_REQUEST_TYPE -1 -#define IO_ERR_TOO_MANY_HANDLERS -2 -#define IO_ERR_DUPLICIT_HANDLER -3 -#define IO_ERR_INVALID_HANDLER -4 -#define IO_ERR_IO_BLOCKED -5 +#define IO_ERR_TOO_MANY_HANDLERS -2 +#define IO_ERR_DUPLICIT_HANDLER -3 +#define IO_ERR_INVALID_HANDLER -4 +#define IO_ERR_IO_BLOCKED -5 typedef void (*io_request_handler_t)(void *request); @@ -55,7 +55,7 @@ int ioBlockOps(int block); #ifdef __DEBUG #define PREINIT_LOG(...) printf(__VA_ARGS__) -#define LOG(...) ioPrintf(__VA_ARGS__) +#define LOG(...) ioPrintf(__VA_ARGS__) #else #define PREINIT_LOG(...) #define LOG(...) diff --git a/include/iosupport.h b/include/iosupport.h index 539a1d36f..658bf9819 100644 --- a/include/iosupport.h +++ b/include/iosupport.h @@ -4,7 +4,7 @@ #include "include/config.h" #define IO_MODE_SELECTED_NONE -1 -#define IO_MODE_SELECTED_ALL MODE_COUNT +#define IO_MODE_SELECTED_ALL MODE_COUNT enum IO_MODES { BDM_MODE = 0, @@ -49,12 +49,12 @@ enum ERROR_CODE { ERROR_HDD_NOT_DETECTED, }; -#define NO_EXCEPTION 0x00 +#define NO_EXCEPTION 0x00 #define UNMOUNT_EXCEPTION 0x01 -#define MODE_FLAG_NO_COMPAT 0x01 // no compat support +#define MODE_FLAG_NO_COMPAT 0x01 // no compat support #define MODE_FLAG_COMPAT_DMA 0x02 // Supports DMA compat flags -#define MODE_FLAG_NO_UPDATE 0x04 // Network update not supported. +#define MODE_FLAG_NO_UPDATE 0x04 // Network update not supported. #define COMPAT_MODE_1 0x01 // Accurate Reads #define COMPAT_MODE_2 0x02 // Alternative data read method (Synchronous) @@ -72,8 +72,8 @@ enum ERROR_CODE { // minimal inactive frames for cover display, can be pretty low since it means no button is pressed :) #define MENU_MIN_INACTIVE_FRAMES 8 -#define MENU_UPD_DELAY_NOUPDATE -1 //Auto refresh is disabled for the item. The refresh button may be used to manually refresh the item. -#define MENU_UPD_DELAY_GENREFRESH 0 //The item will be refreshed every MENU_GENERAL_UPDATE_DELAY frames, regardless of whether automatic refresh is enabled or not. +#define MENU_UPD_DELAY_NOUPDATE -1 //Auto refresh is disabled for the item. The refresh button may be used to manually refresh the item. +#define MENU_UPD_DELAY_GENREFRESH 0 //The item will be refreshed every MENU_GENERAL_UPDATE_DELAY frames, regardless of whether automatic refresh is enabled or not. typedef struct { diff --git a/include/nbns.h b/include/nbns.h index 3e8d4af70..07cbb6d9c 100644 --- a/include/nbns.h +++ b/include/nbns.h @@ -19,7 +19,7 @@ int nbnsFindName(const char *name, unsigned char *ip_address); #ifdef _IOP #define nbnsman_IMPORTS_start DECLARE_IMPORT_TABLE(nbnsman, 1, 1) -#define nbnsman_IMPORTS_end END_IMPORT_TABLE +#define nbnsman_IMPORTS_end END_IMPORT_TABLE #define I_nbnsFindName DECLARE_IMPORT(4, nbnsFindName) #endif diff --git a/include/opl.h b/include/opl.h index 023ada2cf..547feba8e 100644 --- a/include/opl.h +++ b/include/opl.h @@ -45,17 +45,17 @@ #define OPL_PARENTAL_LOCK_MASTER_PASS "989765" //IO type IDs -#define IO_CUSTOM_SIMPLEACTION 1 // handler for parameter-less actions -#define IO_MENU_UPDATE_DEFFERED 2 -#define IO_CACHE_LOAD_ART 3 // io call to handle the loading of covers +#define IO_CUSTOM_SIMPLEACTION 1 // handler for parameter-less actions +#define IO_MENU_UPDATE_DEFFERED 2 +#define IO_CACHE_LOAD_ART 3 // io call to handle the loading of covers #define IO_COMPAT_UPDATE_DEFFERED 4 //Codes have been planned to fit the design of the GUI functions within gui.c. -#define OPL_COMPAT_UPDATE_STAT_WIP 0 -#define OPL_COMPAT_UPDATE_STAT_DONE 1 -#define OPL_COMPAT_UPDATE_STAT_ERROR -1 +#define OPL_COMPAT_UPDATE_STAT_WIP 0 +#define OPL_COMPAT_UPDATE_STAT_DONE 1 +#define OPL_COMPAT_UPDATE_STAT_ERROR -1 #define OPL_COMPAT_UPDATE_STAT_CONN_ERROR -2 -#define OPL_COMPAT_UPDATE_STAT_ABORTED -3 +#define OPL_COMPAT_UPDATE_STAT_ABORTED -3 #define OPL_VMODE_CHANGE_CONFIRMATION_TIMEOUT_MS 10000 diff --git a/include/pad.h b/include/pad.h index 6c836a8ad..9f35da8e2 100644 --- a/include/pad.h +++ b/include/pad.h @@ -3,22 +3,22 @@ //PAD handling -#define KEY_LEFT 1 -#define KEY_DOWN 2 -#define KEY_RIGHT 3 -#define KEY_UP 4 -#define KEY_START 5 -#define KEY_R3 6 -#define KEY_L3 7 -#define KEY_SELECT 8 -#define KEY_SQUARE 9 -#define KEY_CROSS 10 -#define KEY_CIRCLE 11 +#define KEY_LEFT 1 +#define KEY_DOWN 2 +#define KEY_RIGHT 3 +#define KEY_UP 4 +#define KEY_START 5 +#define KEY_R3 6 +#define KEY_L3 7 +#define KEY_SELECT 8 +#define KEY_SQUARE 9 +#define KEY_CROSS 10 +#define KEY_CIRCLE 11 #define KEY_TRIANGLE 12 -#define KEY_R1 13 -#define KEY_L1 14 -#define KEY_R2 15 -#define KEY_L2 16 +#define KEY_R1 13 +#define KEY_L1 14 +#define KEY_R2 15 +#define KEY_L2 16 int startPads(); int readPads(); diff --git a/include/pggsm.h b/include/pggsm.h index 88b68f87a..672789938 100644 --- a/include/pggsm.h +++ b/include/pggsm.h @@ -17,7 +17,7 @@ #define __PGGSM_H #define GSM_VERSION "0.40" -#define GSM_ARGS 1 +#define GSM_ARGS 1 #define makeSMODE1(VHP, VCKSEL, SLCK2, NVCK, CLKSEL, PEVS, PEHS, PVS, PHS, GCONT, SPML, PCK2, XPCK, SINT, PRST, EX, CMOD, SLCK, T1248, LC, RC) \ (u64)(((u64)(VHP) << 36) | ((u64)(VCKSEL) << 34) | ((u64)(SLCK2) << 33) | \ diff --git a/include/renderman.h b/include/renderman.h index de24de339..a745c15a6 100644 --- a/include/renderman.h +++ b/include/renderman.h @@ -21,16 +21,16 @@ #define DIM_UNDEF -1 -#define ALIGN_TOP (0 << 0) -#define ALIGN_BOTTOM (1 << 0) +#define ALIGN_TOP (0 << 0) +#define ALIGN_BOTTOM (1 << 0) #define ALIGN_VCENTER (2 << 0) -#define ALIGN_LEFT (0 << 2) -#define ALIGN_RIGHT (1 << 2) +#define ALIGN_LEFT (0 << 2) +#define ALIGN_RIGHT (1 << 2) #define ALIGN_HCENTER (2 << 2) -#define ALIGN_NONE (ALIGN_TOP | ALIGN_LEFT) -#define ALIGN_CENTER (ALIGN_VCENTER | ALIGN_HCENTER) +#define ALIGN_NONE (ALIGN_TOP | ALIGN_LEFT) +#define ALIGN_CENTER (ALIGN_VCENTER | ALIGN_HCENTER) -#define SCALING_NONE 0 +#define SCALING_NONE 0 #define SCALING_RATIO 1 /// GSKit CLUT base struct. This should've been in gsKit from the start :) diff --git a/include/supportbase.h b/include/supportbase.h index cd6987d11..95aef169c 100644 --- a/include/supportbase.h +++ b/include/supportbase.h @@ -1,10 +1,10 @@ #ifndef __SUPPORT_BASE_H #define __SUPPORT_BASE_H -#define UL_GAME_NAME_MAX 32 -#define ISO_GAME_NAME_MAX 64 +#define UL_GAME_NAME_MAX 32 +#define ISO_GAME_NAME_MAX 64 #define ISO_GAME_EXTENSION_MAX 4 -#define GAME_STARTUP_MAX 12 +#define GAME_STARTUP_MAX 12 #define ISO_GAME_FNAME_MAX (ISO_GAME_NAME_MAX + ISO_GAME_EXTENSION_MAX) diff --git a/include/system.h b/include/system.h index 52e620f1b..2d9f8f1e8 100644 --- a/include/system.h +++ b/include/system.h @@ -3,8 +3,8 @@ #include "include/mcemu.h" -#define SYS_LOAD_MC_MODULES 0x01 -#define SYS_LOAD_USB_MODULES 0x02 +#define SYS_LOAD_MC_MODULES 0x01 +#define SYS_LOAD_USB_MODULES 0x02 #define SYS_LOAD_ISOFS_MODULE 0x04 unsigned int USBA_crc32(const char *string); diff --git a/include/textures.h b/include/textures.h index abf4a88d6..297498236 100644 --- a/include/textures.h +++ b/include/textures.h @@ -83,13 +83,13 @@ enum INTERNAL_TEXTURE { TEXTURES_COUNT }; -#define ERR_BAD_FILE -1 -#define ERR_READ_STRUCT -2 -#define ERR_INFO_STRUCT -3 -#define ERR_SET_JMP -4 +#define ERR_BAD_FILE -1 +#define ERR_READ_STRUCT -2 +#define ERR_INFO_STRUCT -3 +#define ERR_SET_JMP -4 #define ERR_BAD_DIMENSION -5 #define ERR_MISSING_ALPHA -6 -#define ERR_BAD_DEPTH -7 +#define ERR_BAD_DEPTH -7 int texLookupInternalTexId(const char *name); int texPngLoad(GSTEXTURE *texture, const char *path, int texId, short psm); diff --git a/labs/genvmclab/Makefile b/labs/genvmclab/Makefile index 6e609bf68..98bdf862c 100644 --- a/labs/genvmclab/Makefile +++ b/labs/genvmclab/Makefile @@ -40,7 +40,7 @@ smsutils.s: smstcpip.s: $(MAKE) -C ../../modules/network/SMSTCPIP $(BIN2S) ../../modules/network/SMSTCPIP/SMSTCPIP.irx smstcpip.s smstcpip_irx - + smsmap.s: $(MAKE) -C ../../modules/network/SMSMAP $(BIN2S) ../../modules/network/SMSMAP/SMSMAP.irx smsmap.s smsmap_irx diff --git a/labs/smblab/Makefile b/labs/smblab/Makefile index ff1a1e3e5..07d78c234 100644 --- a/labs/smblab/Makefile +++ b/labs/smblab/Makefile @@ -37,7 +37,7 @@ smsutils.s: smstcpip.s: $(MAKE) -C ../../modules/network/SMSTCPIP $(BIN2S) ../../modules/network/SMSTCPIP/SMSTCPIP.irx smstcpip.s smstcpip_irx - + smsmap.s: $(MAKE) -C ../../modules/network/SMSMAP $(BIN2S) ../../modules/network/SMSMAP/SMSMAP.irx smsmap.s smsmap_irx diff --git a/misc/conf_theme_OPL.cfg b/misc/conf_theme_OPL.cfg index 978e2c0f6..1f2288544 100755 --- a/misc/conf_theme_OPL.cfg +++ b/misc/conf_theme_OPL.cfg @@ -159,4 +159,4 @@ info16: info17: type=InfoHintText aligned=1 - x=POS_MID \ No newline at end of file + x=POS_MID diff --git a/modules/debug/ioptrap/exports.tab b/modules/debug/ioptrap/exports.tab index 1ab692e0b..64683ca11 100644 --- a/modules/debug/ioptrap/exports.tab +++ b/modules/debug/ioptrap/exports.tab @@ -3,7 +3,7 @@ DECLARE_EXPORT_TABLE(ioptrap, 1, 1) DECLARE_EXPORT(_retonly) DECLARE_EXPORT(shutdown) DECLARE_EXPORT(_retonly) - + DECLARE_EXPORT(get_exception_name) /*05*/ DECLARE_EXPORT(dbg_setjmp) DECLARE_EXPORT(set_exception_handler) @@ -14,7 +14,7 @@ DECLARE_EXPORT_TABLE(ioptrap, 1, 1) DECLARE_EXPORT(get_dba) DECLARE_EXPORT(get_dbam) DECLARE_EXPORT(get_dcic) - + END_EXPORT_TABLE void _retonly() {} diff --git a/modules/debug/ioptrap/handler.S b/modules/debug/ioptrap/handler.S index 452cb536c..2b4e932bb 100644 --- a/modules/debug/ioptrap/handler.S +++ b/modules/debug/ioptrap/handler.S @@ -25,38 +25,38 @@ def_exc_handler: .word 0 la $k0, __trap_frame sw $0, 0x10($k0) - + lw $1, 0x400($0) - nop - sw $1, 0x14($k0) - - sw $2, 0x18($k0) - sw $3, 0x1c($k0) - sw $4, 0x20($k0) - sw $5, 0x24($k0) - sw $6, 0x28($k0) - sw $7, 0x2c($k0) - sw $8, 0x30($k0) - sw $9, 0x34($k0) - sw $10, 0x38($k0) - sw $11, 0x3c($k0) - sw $12, 0x40($k0) - sw $13, 0x44($k0) - sw $14, 0x48($k0) - sw $15, 0x4c($k0) - sw $16, 0x50($k0) - sw $17, 0x54($k0) - sw $18, 0x58($k0) - sw $19, 0x5c($k0) - sw $20, 0x60($k0) - sw $21, 0x64($k0) - sw $22, 0x68($k0) - sw $23, 0x6c($k0) - sw $24, 0x70($k0) - sw $25, 0x74($k0) - sw $26, 0x78($k0) - sw $27, 0x7c($k0) - sw $28, 0x80($k0) + nop + sw $1, 0x14($k0) + + sw $2, 0x18($k0) + sw $3, 0x1c($k0) + sw $4, 0x20($k0) + sw $5, 0x24($k0) + sw $6, 0x28($k0) + sw $7, 0x2c($k0) + sw $8, 0x30($k0) + sw $9, 0x34($k0) + sw $10, 0x38($k0) + sw $11, 0x3c($k0) + sw $12, 0x40($k0) + sw $13, 0x44($k0) + sw $14, 0x48($k0) + sw $15, 0x4c($k0) + sw $16, 0x50($k0) + sw $17, 0x54($k0) + sw $18, 0x58($k0) + sw $19, 0x5c($k0) + sw $20, 0x60($k0) + sw $21, 0x64($k0) + sw $22, 0x68($k0) + sw $23, 0x6c($k0) + sw $24, 0x70($k0) + sw $25, 0x74($k0) + sw $26, 0x78($k0) + sw $27, 0x7c($k0) + sw $28, 0x80($k0) sw $29, 0x84($k0) sw $30, 0x88($k0) sw $31, 0x8c($k0) @@ -68,17 +68,17 @@ def_exc_handler: nop sw $a0, 0x94($k0) - + #lw $a0, 0x404($0) # saved EPC mfc0 $a0, $14 #EPC nop sw $a0, 0($k0) - + #lw $a0, 0x408($0) # saved SR mfc0 $a0, $12 #SR nop sw $a0, 0xc($k0) - + mfc0 $a0, $8 # BadVaddr nop sw $a0, 0x8($k0) @@ -106,35 +106,35 @@ def_exc_handler: nop mthi $a0 - #lw $0, 0x10($k0) - lw $1, 0x14($k0) - lw $2, 0x18($k0) - lw $3, 0x1c($k0) - lw $4, 0x20($k0) - lw $5, 0x24($k0) - lw $6, 0x28($k0) - lw $7, 0x2c($k0) - lw $8, 0x30($k0) - lw $9, 0x34($k0) - lw $10, 0x38($k0) - lw $11, 0x3c($k0) - lw $12, 0x40($k0) - lw $13, 0x44($k0) - lw $14, 0x48($k0) - lw $15, 0x4c($k0) - lw $16, 0x50($k0) - lw $17, 0x54($k0) - lw $18, 0x58($k0) - lw $19, 0x5c($k0) - lw $20, 0x60($k0) - lw $21, 0x64($k0) - lw $22, 0x68($k0) - lw $23, 0x6c($k0) - lw $24, 0x70($k0) - lw $25, 0x74($k0) - #lw $26, 0x78($k0) - #lw $27, 0x7c($k0) - lw $28, 0x80($k0) + #lw $0, 0x10($k0) + lw $1, 0x14($k0) + lw $2, 0x18($k0) + lw $3, 0x1c($k0) + lw $4, 0x20($k0) + lw $5, 0x24($k0) + lw $6, 0x28($k0) + lw $7, 0x2c($k0) + lw $8, 0x30($k0) + lw $9, 0x34($k0) + lw $10, 0x38($k0) + lw $11, 0x3c($k0) + lw $12, 0x40($k0) + lw $13, 0x44($k0) + lw $14, 0x48($k0) + lw $15, 0x4c($k0) + lw $16, 0x50($k0) + lw $17, 0x54($k0) + lw $18, 0x58($k0) + lw $19, 0x5c($k0) + lw $20, 0x60($k0) + lw $21, 0x64($k0) + lw $22, 0x68($k0) + lw $23, 0x6c($k0) + lw $24, 0x70($k0) + lw $25, 0x74($k0) + #lw $26, 0x78($k0) + #lw $27, 0x7c($k0) + lw $28, 0x80($k0) lw $29, 0x84($k0) lw $30, 0x88($k0) lw $31, 0x8c($k0) @@ -151,7 +151,7 @@ def_exc_handler: cop0 0x10 nop .end def_exc_handler - + .global bp_exc_handler .ent bp_exc_handler bp_exc_handler: @@ -160,35 +160,35 @@ bp_exc_handler: .word 0 .word 0 la $k0, __trap_frame - sw $0, 0x10($k0) - sw $1, 0x14($k0) - sw $2, 0x18($k0) - sw $3, 0x1c($k0) - sw $4, 0x20($k0) - sw $5, 0x24($k0) - sw $6, 0x28($k0) - sw $7, 0x2c($k0) - sw $8, 0x30($k0) - sw $9, 0x34($k0) - sw $10, 0x38($k0) - sw $11, 0x3c($k0) - sw $12, 0x40($k0) - sw $13, 0x44($k0) - sw $14, 0x48($k0) - sw $15, 0x4c($k0) - sw $16, 0x50($k0) - sw $17, 0x54($k0) - sw $18, 0x58($k0) - sw $19, 0x5c($k0) - sw $20, 0x60($k0) - sw $21, 0x64($k0) - sw $22, 0x68($k0) - sw $23, 0x6c($k0) - sw $24, 0x70($k0) - sw $25, 0x74($k0) - sw $26, 0x78($k0) - sw $27, 0x7c($k0) - sw $28, 0x80($k0) + sw $0, 0x10($k0) + sw $1, 0x14($k0) + sw $2, 0x18($k0) + sw $3, 0x1c($k0) + sw $4, 0x20($k0) + sw $5, 0x24($k0) + sw $6, 0x28($k0) + sw $7, 0x2c($k0) + sw $8, 0x30($k0) + sw $9, 0x34($k0) + sw $10, 0x38($k0) + sw $11, 0x3c($k0) + sw $12, 0x40($k0) + sw $13, 0x44($k0) + sw $14, 0x48($k0) + sw $15, 0x4c($k0) + sw $16, 0x50($k0) + sw $17, 0x54($k0) + sw $18, 0x58($k0) + sw $19, 0x5c($k0) + sw $20, 0x60($k0) + sw $21, 0x64($k0) + sw $22, 0x68($k0) + sw $23, 0x6c($k0) + sw $24, 0x70($k0) + sw $25, 0x74($k0) + sw $26, 0x78($k0) + sw $27, 0x7c($k0) + sw $28, 0x80($k0) sw $29, 0x84($k0) sw $30, 0x88($k0) sw $31, 0x8c($k0) @@ -200,17 +200,17 @@ bp_exc_handler: nop sw $a0, 0x94($k0) - + #lw $a0, 0x424($0) # saved EPC mfc0 $a0, $14 #EPC nop sw $a0, 0($k0) - + #lw $a0, 0x42c($0) # saved SR mfc0 $a0, $12 #SR nop sw $a0, 0xc($k0) - + mfc0 $a0, $8 # BadVaddr nop sw $a0, 0x8($k0) @@ -219,7 +219,7 @@ bp_exc_handler: nop sw $a0, 0x98($k0) - + #lw $a0, 0x428($0) # saved Cause mfc0 $a0, $13 #Cause nop @@ -230,7 +230,7 @@ bp_exc_handler: jal trap or $a1, $k0, $0 - + la $k0, __trap_frame lw $a0, 0x94($k0) @@ -244,36 +244,36 @@ bp_exc_handler: lw $a0, 0x98($k0) nop mtc0 $a0, $7 - - #lw $0, 0x10($k0) - lw $1, 0x14($k0) - lw $2, 0x18($k0) - lw $3, 0x1c($k0) - lw $4, 0x20($k0) - lw $5, 0x24($k0) - lw $6, 0x28($k0) - lw $7, 0x2c($k0) - lw $8, 0x30($k0) - lw $9, 0x34($k0) - lw $10, 0x38($k0) - lw $11, 0x3c($k0) - lw $12, 0x40($k0) - lw $13, 0x44($k0) - lw $14, 0x48($k0) - lw $15, 0x4c($k0) - lw $16, 0x50($k0) - lw $17, 0x54($k0) - lw $18, 0x58($k0) - lw $19, 0x5c($k0) - lw $20, 0x60($k0) - lw $21, 0x64($k0) - lw $22, 0x68($k0) - lw $23, 0x6c($k0) - lw $24, 0x70($k0) - lw $25, 0x74($k0) - #lw $26, 0x78($k0) - #lw $27, 0x7c($k0) - lw $28, 0x80($k0) + + #lw $0, 0x10($k0) + lw $1, 0x14($k0) + lw $2, 0x18($k0) + lw $3, 0x1c($k0) + lw $4, 0x20($k0) + lw $5, 0x24($k0) + lw $6, 0x28($k0) + lw $7, 0x2c($k0) + lw $8, 0x30($k0) + lw $9, 0x34($k0) + lw $10, 0x38($k0) + lw $11, 0x3c($k0) + lw $12, 0x40($k0) + lw $13, 0x44($k0) + lw $14, 0x48($k0) + lw $15, 0x4c($k0) + lw $16, 0x50($k0) + lw $17, 0x54($k0) + lw $18, 0x58($k0) + lw $19, 0x5c($k0) + lw $20, 0x60($k0) + lw $21, 0x64($k0) + lw $22, 0x68($k0) + lw $23, 0x6c($k0) + lw $24, 0x70($k0) + lw $25, 0x74($k0) + #lw $26, 0x78($k0) + #lw $27, 0x7c($k0) + lw $28, 0x80($k0) lw $29, 0x84($k0) lw $30, 0x88($k0) lw $31, 0x8c($k0) @@ -290,4 +290,4 @@ bp_exc_handler: cop0 0x10 nop .end bp_exc_handler - + diff --git a/modules/debug/ioptrap/ioptrap.h b/modules/debug/ioptrap/ioptrap.h index 4ae694dd8..cc7fb442c 100644 --- a/modules/debug/ioptrap/ioptrap.h +++ b/modules/debug/ioptrap/ioptrap.h @@ -56,7 +56,7 @@ typedef void (*trap_exception_handler_t)(exception_type_t, exception_frame_t *); #define DCIC_PC (1 << 24) #define ioptrap_IMPORTS_start DECLARE_IMPORT_TABLE(ioptrap, 1, 1) -#define ioptrap_IMPORTS_end END_IMPORT_TABLE +#define ioptrap_IMPORTS_end END_IMPORT_TABLE const char *get_exception_name(exception_type_t type); #define I_get_exception_name DECLARE_IMPORT(4, get_exception_name) diff --git a/modules/debug/ps2link/LICENSE b/modules/debug/ps2link/LICENSE index bf1b9f9fe..ae1aca2eb 100644 --- a/modules/debug/ps2link/LICENSE +++ b/modules/debug/ps2link/LICENSE @@ -135,7 +135,7 @@ conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and -penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et seq., the +penalties of the U.S. Copyright Act, 17 U.S.C. � 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License. diff --git a/modules/debug/ps2link/hostlink.h b/modules/debug/ps2link/hostlink.h index 438a9b0aa..c206c1406 100644 --- a/modules/debug/ps2link/hostlink.h +++ b/modules/debug/ps2link/hostlink.h @@ -5,76 +5,76 @@ * details. */ -#define PKO_PORT 0x4711 -#define PKO_CMD_PORT 0x4712 +#define PKO_PORT 0x4711 +#define PKO_CMD_PORT 0x4712 #define PKO_PRINTF_PORT 0x4712 -#define PKO_OPEN_CMD 0xbabe0111 -#define PKO_OPEN_RLY 0xbabe0112 -#define PKO_CLOSE_CMD 0xbabe0121 -#define PKO_CLOSE_RLY 0xbabe0122 -#define PKO_READ_CMD 0xbabe0131 -#define PKO_READ_RLY 0xbabe0132 -#define PKO_WRITE_CMD 0xbabe0141 -#define PKO_WRITE_RLY 0xbabe0142 -#define PKO_LSEEK_CMD 0xbabe0151 -#define PKO_LSEEK_RLY 0xbabe0152 -#define PKO_OPENDIR_CMD 0xbabe0161 -#define PKO_OPENDIR_RLY 0xbabe0162 +#define PKO_OPEN_CMD 0xbabe0111 +#define PKO_OPEN_RLY 0xbabe0112 +#define PKO_CLOSE_CMD 0xbabe0121 +#define PKO_CLOSE_RLY 0xbabe0122 +#define PKO_READ_CMD 0xbabe0131 +#define PKO_READ_RLY 0xbabe0132 +#define PKO_WRITE_CMD 0xbabe0141 +#define PKO_WRITE_RLY 0xbabe0142 +#define PKO_LSEEK_CMD 0xbabe0151 +#define PKO_LSEEK_RLY 0xbabe0152 +#define PKO_OPENDIR_CMD 0xbabe0161 +#define PKO_OPENDIR_RLY 0xbabe0162 #define PKO_CLOSEDIR_CMD 0xbabe0171 #define PKO_CLOSEDIR_RLY 0xbabe0172 -#define PKO_READDIR_CMD 0xbabe0181 -#define PKO_READDIR_RLY 0xbabe0182 -#define PKO_REMOVE_CMD 0xbabe0191 -#define PKO_REMOVE_RLY 0xbabe0192 -#define PKO_MKDIR_CMD 0xbabe01a1 -#define PKO_MKDIR_RLY 0xbabe01a2 -#define PKO_RMDIR_CMD 0xbabe01b1 -#define PKO_RMDIR_RLY 0xbabe01b2 - -#define PKO_RESET_CMD 0xbabe0201 -#define PKO_EXECIOP_CMD 0xbabe0202 -#define PKO_EXECEE_CMD 0xbabe0203 +#define PKO_READDIR_CMD 0xbabe0181 +#define PKO_READDIR_RLY 0xbabe0182 +#define PKO_REMOVE_CMD 0xbabe0191 +#define PKO_REMOVE_RLY 0xbabe0192 +#define PKO_MKDIR_CMD 0xbabe01a1 +#define PKO_MKDIR_RLY 0xbabe01a2 +#define PKO_RMDIR_CMD 0xbabe01b1 +#define PKO_RMDIR_RLY 0xbabe01b2 + +#define PKO_RESET_CMD 0xbabe0201 +#define PKO_EXECIOP_CMD 0xbabe0202 +#define PKO_EXECEE_CMD 0xbabe0203 #define PKO_POWEROFF_CMD 0xbabe0204 -#define PKO_SCRDUMP_CMD 0xbabe0205 -#define PKO_NETDUMP_CMD 0xbabe0206 - -#define PKO_DUMP_MEM 0xbabe0207 -#define PKO_START_VU 0xbabe0208 -#define PKO_STOP_VU 0xbabe0209 -#define PKO_DUMP_REG 0xbabe020a -#define PKO_GSEXEC_CMD 0xbabe020b -#define PKO_WRITE_MEM 0xbabe020c +#define PKO_SCRDUMP_CMD 0xbabe0205 +#define PKO_NETDUMP_CMD 0xbabe0206 + +#define PKO_DUMP_MEM 0xbabe0207 +#define PKO_START_VU 0xbabe0208 +#define PKO_STOP_VU 0xbabe0209 +#define PKO_DUMP_REG 0xbabe020a +#define PKO_GSEXEC_CMD 0xbabe020b +#define PKO_WRITE_MEM 0xbabe020c #define PKO_IOPEXCEP_CMD 0xbabe020d -#define PKO_RPC_RESET 1 -#define PKO_RPC_EXECEE 2 -#define PKO_RPC_DUMMY 3 -#define PKO_RPC_SCRDUMP 4 -#define PKO_RPC_NETDUMP 5 -#define PKO_RPC_STARTVU 6 -#define PKO_RPC_STOPVU 7 -#define PKO_RPC_DUMPMEM 8 -#define PKO_RPC_DUMPREG 9 -#define PKO_RPC_GSEXEC 10 +#define PKO_RPC_RESET 1 +#define PKO_RPC_EXECEE 2 +#define PKO_RPC_DUMMY 3 +#define PKO_RPC_SCRDUMP 4 +#define PKO_RPC_NETDUMP 5 +#define PKO_RPC_STARTVU 6 +#define PKO_RPC_STOPVU 7 +#define PKO_RPC_DUMPMEM 8 +#define PKO_RPC_DUMPREG 9 +#define PKO_RPC_GSEXEC 10 #define PKO_RPC_WRITEMEM 11 #define PKO_RPC_IOPEXCEP 12 #define PKO_MAX_PATH 256 -#define REGDMA 0 -#define REGINTC 1 +#define REGDMA 0 +#define REGINTC 1 #define REGTIMER 2 -#define REGGS 3 -#define REGSIF 4 -#define REGFIFO 5 -#define REGGIF 6 -#define REGVIF0 7 -#define REGVIF1 8 -#define REGIPU 9 -#define REGALL 10 -#define REGVU0 11 -#define REGVU1 12 +#define REGGS 3 +#define REGSIF 4 +#define REGFIFO 5 +#define REGGIF 6 +#define REGVIF0 7 +#define REGVIF1 8 +#define REGIPU 9 +#define REGALL 10 +#define REGVU0 11 +#define REGVU1 12 typedef struct { @@ -259,4 +259,4 @@ typedef struct } __attribute__((packed)) pko_pkt_send_regs; #define PKO_MAX_WRITE_SEGMENT (1460 - sizeof(pko_pkt_write_req)) -#define PKO_MAX_READ_SEGMENT (1460 - sizeof(pko_pkt_read_rly)) +#define PKO_MAX_READ_SEGMENT (1460 - sizeof(pko_pkt_read_rly)) diff --git a/modules/debug/ps2link/imports.lst b/modules/debug/ps2link/imports.lst index bc4838af3..0522f5008 100644 --- a/modules/debug/ps2link/imports.lst +++ b/modules/debug/ps2link/imports.lst @@ -1,4 +1,3 @@ - stdio_IMPORTS_start I_printf stdio_IMPORTS_end diff --git a/modules/debug/ps2link/nprintf.c b/modules/debug/ps2link/nprintf.c index b4f98b17c..504858940 100644 --- a/modules/debug/ps2link/nprintf.c +++ b/modules/debug/ps2link/nprintf.c @@ -15,7 +15,7 @@ #include //////////////////////////////////////////////////////////////////////// -#define NPM_PUTS 0x01 +#define NPM_PUTS 0x01 #define RPC_NPM_USER 0x014d704e //////////////////////////////////////////////////////////////////////// diff --git a/modules/debug/udptty-ingame/imports.lst b/modules/debug/udptty-ingame/imports.lst index 6239fd3ea..b9ec20f4e 100644 --- a/modules/debug/udptty-ingame/imports.lst +++ b/modules/debug/udptty-ingame/imports.lst @@ -1,4 +1,3 @@ - thsemap_IMPORTS_start I_DeleteSema I_SignalSema diff --git a/modules/debug/udptty-ingame/udptty.c b/modules/debug/udptty-ingame/udptty.c index b0535c531..59b285613 100644 --- a/modules/debug/udptty-ingame/udptty.c +++ b/modules/debug/udptty-ingame/udptty.c @@ -75,7 +75,7 @@ static iop_device_t tty_device = { /* KPRTTY */ #ifdef KPRTTY #define PRNT_IO_BEGIN 0x200 -#define PRNT_IO_END 0x201 +#define PRNT_IO_END 0x201 typedef struct _KprArg { diff --git a/modules/ds34bt/Makefile b/modules/ds34bt/Makefile index 839f9e495..ee9ee9c00 100644 --- a/modules/ds34bt/Makefile +++ b/modules/ds34bt/Makefile @@ -1,11 +1,11 @@ all: - $(MAKE) -C iop + $(MAKE) -C iop $(MAKE) -C ee clean: $(MAKE) -C iop clean $(MAKE) -C ee clean - + rebuild: $(MAKE) -C iop rebuild - $(MAKE) -C ee rebuild \ No newline at end of file + $(MAKE) -C ee rebuild diff --git a/modules/ds34bt/ee/Makefile b/modules/ds34bt/ee/Makefile index 251c7fa15..af53d6c8c 100644 --- a/modules/ds34bt/ee/Makefile +++ b/modules/ds34bt/ee/Makefile @@ -9,7 +9,7 @@ all: $(EE_LIB) clean: rm -f -r $(EE_OBJS) $(EE_LIB) -rebuild: clean all +rebuild: clean all include $(PS2SDK)/samples/Makefile.pref include $(PS2SDK)/samples/Makefile.eeglobal diff --git a/modules/ds34bt/ee/libds34bt.c b/modules/ds34bt/ee/libds34bt.c index 791b94ea2..ac63ee352 100644 --- a/modules/ds34bt/ee/libds34bt.c +++ b/modules/ds34bt/ee/libds34bt.c @@ -3,16 +3,16 @@ #include #include "libds34bt.h" -#define DS34BT_INIT 1 +#define DS34BT_INIT 1 #define DS34BT_INIT_CHARGING 2 -#define DS34BT_GET_STATUS 3 -#define DS34BT_GET_BDADDR 4 -#define DS34BT_SET_RUMBLE 5 -#define DS34BT_SET_LED 6 -#define DS34BT_GET_DATA 7 -#define DS34BT_RESET 8 -#define DS34BT_GET_VERSION 9 -#define DS34BT_GET_FEATURES 10 +#define DS34BT_GET_STATUS 3 +#define DS34BT_GET_BDADDR 4 +#define DS34BT_SET_RUMBLE 5 +#define DS34BT_SET_LED 6 +#define DS34BT_GET_DATA 7 +#define DS34BT_RESET 8 +#define DS34BT_GET_VERSION 9 +#define DS34BT_GET_FEATURES 10 #define DS34BT_BIND_RPC_ID 0x18E3878F diff --git a/modules/ds34bt/iop/ds34bt.c b/modules/ds34bt/iop/ds34bt.c index 4ee875b09..5ae19361f 100644 --- a/modules/ds34bt/iop/ds34bt.c +++ b/modules/ds34bt/iop/ds34bt.c @@ -340,7 +340,7 @@ static u8 GenuineMacAddress[][3] = //fake with AirohaTechnologyCorp's Chip {0x0C, 0xFC, 0x83}}; -#define REQ_HCI_OUT (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE) +#define REQ_HCI_OUT (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE) #define HCI_COMMAND_REQ 0 #define MAX_PADS 2 @@ -1611,16 +1611,16 @@ static SifRpcServerData_t rpc_svr __attribute__((aligned(16))); static int rpc_buf[64] __attribute((aligned(16))); -#define DS34BT_INIT 1 +#define DS34BT_INIT 1 #define DS34BT_INIT_CHARGING 2 -#define DS34BT_GET_STATUS 3 -#define DS34BT_GET_BDADDR 4 -#define DS34BT_SET_RUMBLE 5 -#define DS34BT_SET_LED 6 -#define DS34BT_GET_DATA 7 -#define DS34BT_RESET 8 -#define DS34BT_GET_VERSION 9 -#define DS34BT_GET_FEATURES 10 +#define DS34BT_GET_STATUS 3 +#define DS34BT_GET_BDADDR 4 +#define DS34BT_SET_RUMBLE 5 +#define DS34BT_SET_LED 6 +#define DS34BT_GET_DATA 7 +#define DS34BT_RESET 8 +#define DS34BT_GET_VERSION 9 +#define DS34BT_GET_FEATURES 10 #define DS34BT_BIND_RPC_ID 0x18E3878F diff --git a/modules/ds34bt/iop/ds34bt.h b/modules/ds34bt/iop/ds34bt.h index 97e88abbc..80eb9de96 100644 --- a/modules/ds34bt/iop/ds34bt.h +++ b/modules/ds34bt/iop/ds34bt.h @@ -4,12 +4,12 @@ #include "irx.h" #define USB_CLASS_WIRELESS_CONTROLLER 0xE0 -#define USB_SUBCLASS_RF_CONTROLLER 0x01 -#define USB_PROTOCOL_BLUETOOTH_PROG 0x01 +#define USB_SUBCLASS_RF_CONTROLLER 0x01 +#define USB_PROTOCOL_BLUETOOTH_PROG 0x01 -#define DS34_VID 0x054C // Sony Corporation -#define DS3_PID 0x0268 // PS3 Controller -#define DS4_PID 0x05C4 // PS4 Controller +#define DS34_VID 0x054C // Sony Corporation +#define DS3_PID 0x0268 // PS3 Controller +#define DS4_PID 0x05C4 // PS4 Controller #define DS4_PID_SLIM 0x09CC // PS4 Slim Controller #define DS3 0 @@ -17,7 +17,7 @@ #define MAX_BUFFER_SIZE 64 // Size of general purpose data buffer -#define PENDING 1 +#define PENDING 1 #define SUCCESSFUL 0 typedef struct @@ -75,11 +75,11 @@ enum eDS34BTStatus { }; #define pad_status_clear(flag, pad) ds34pad[pad].status &= ~flag -#define pad_status_set(flag, pad) ds34pad[pad].status |= flag +#define pad_status_set(flag, pad) ds34pad[pad].status |= flag #define pad_status_check(flag, pad) (ds34pad[pad].status & flag) #define hci_event_flag_clear(flag) hci_event_flag &= ~flag -#define hci_event_flag_set(flag) hci_event_flag |= flag +#define hci_event_flag_set(flag) hci_event_flag |= flag #define hci_event_flag_check(flag) (hci_event_flag & flag) enum eHCI { @@ -221,9 +221,9 @@ enum eL2CAP { }; #define l2cap_handle_ok(handle) (((u16)(l2cap_buf[0] | (l2cap_buf[1] << 8)) & 0x0FFF) == (u16)(handle & 0x0FFF)) -#define l2cap_control_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == 0x0001) // Channel ID for ACL-U +#define l2cap_control_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == 0x0001) // Channel ID for ACL-U #define l2cap_interrupt_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == interrupt_dcid) -#define l2cap_command_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == control_dcid) +#define l2cap_command_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == control_dcid) enum eHID { // {{{ @@ -261,13 +261,13 @@ struct ds3report struct { u8 Select : 1; - u8 L3 : 1; - u8 R3 : 1; - u8 Start : 1; - u8 Up : 1; - u8 Right : 1; - u8 Down : 1; - u8 Left : 1; + u8 L3 : 1; + u8 R3 : 1; + u8 Start : 1; + u8 Up : 1; + u8 Right : 1; + u8 Down : 1; + u8 Left : 1; }; }; union @@ -275,14 +275,14 @@ struct ds3report u8 ButtonStateH; // Main buttons High struct { - u8 L2 : 1; - u8 R2 : 1; - u8 L1 : 1; - u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 L1 : 1; + u8 R1 : 1; u8 Triangle : 1; - u8 Circle : 1; - u8 Cross : 1; - u8 Square : 1; + u8 Circle : 1; + u8 Cross : 1; + u8 Square : 1; }; }; u8 PSButtonState; // PS button @@ -319,25 +319,25 @@ struct ds3report struct ds4report { u8 ReportID; - u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid - u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid - u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid - u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid - u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW - u8 Square : 1; - u8 Cross : 1; - u8 Circle : 1; + u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid + u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid + u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid + u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid + u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW + u8 Square : 1; + u8 Cross : 1; + u8 Circle : 1; u8 Triangle : 1; - u8 L1 : 1; - u8 R1 : 1; - u8 L2 : 1; - u8 R2 : 1; - u8 Share : 1; - u8 Option : 1; - u8 L3 : 1; - u8 R3 : 1; + u8 L1 : 1; + u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 Share : 1; + u8 Option : 1; + u8 L3 : 1; + u8 R3 : 1; u8 PSButton : 1; - u8 TPad : 1; + u8 TPad : 1; u8 Counter1 : 6; // counts up by 1 per report u8 PressureL2; // digital Pad L2 button Pressure 0 - 255 u8 PressureR2; // digital Pad R2 button Pressure 0 - 255 @@ -350,23 +350,23 @@ struct ds4report s16 GyroZ; s16 GyroY; s16 GyroX; - u8 Reserved1[5]; // Unknown - u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged + u8 Reserved1[5]; // Unknown + u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged u8 Usb_plugged : 1; - u8 Headphones : 1; - u8 Microphone : 1; - u8 Padding : 1; - u8 Reserved2[2]; // Unknown - u8 TPpack; // number of trackpad packets (0x00 to 0x04) - u8 PackCounter; // packet counter - u8 Finger1ID : 7; // counter - u8 Finger1Active : 1; // 0 - active, 1 - unactive - u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 - u16 Finger1Y : 12; - u8 Finger2ID : 7; + u8 Headphones : 1; + u8 Microphone : 1; + u8 Padding : 1; + u8 Reserved2[2]; // Unknown + u8 TPpack; // number of trackpad packets (0x00 to 0x04) + u8 PackCounter; // packet counter + u8 Finger1ID : 7; // counter + u8 Finger1Active : 1; // 0 - active, 1 - unactive + u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 + u16 Finger1Y : 12; + u8 Finger2ID : 7; u8 Finger2Active : 1; - u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 - u16 Finger2Y : 12; + u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 + u16 Finger2Y : 12; } __attribute__((packed)); diff --git a/modules/ds34usb/Makefile b/modules/ds34usb/Makefile index 839f9e495..ee9ee9c00 100644 --- a/modules/ds34usb/Makefile +++ b/modules/ds34usb/Makefile @@ -1,11 +1,11 @@ all: - $(MAKE) -C iop + $(MAKE) -C iop $(MAKE) -C ee clean: $(MAKE) -C iop clean $(MAKE) -C ee clean - + rebuild: $(MAKE) -C iop rebuild - $(MAKE) -C ee rebuild \ No newline at end of file + $(MAKE) -C ee rebuild diff --git a/modules/ds34usb/ee/Makefile b/modules/ds34usb/ee/Makefile index 31a34b2fe..d9daa916a 100644 --- a/modules/ds34usb/ee/Makefile +++ b/modules/ds34usb/ee/Makefile @@ -9,7 +9,7 @@ all: $(EE_LIB) clean: rm -f -r $(EE_OBJS) $(EE_LIB) -rebuild: clean all +rebuild: clean all include $(PS2SDK)/samples/Makefile.pref include $(PS2SDK)/samples/Makefile.eeglobal diff --git a/modules/ds34usb/ee/libds34usb.c b/modules/ds34usb/ee/libds34usb.c index 936c1bc46..89b27e920 100644 --- a/modules/ds34usb/ee/libds34usb.c +++ b/modules/ds34usb/ee/libds34usb.c @@ -2,14 +2,14 @@ #include #include -#define DS34USB_INIT 1 +#define DS34USB_INIT 1 #define DS34USB_GET_STATUS 2 #define DS34USB_GET_BDADDR 3 #define DS34USB_SET_BDADDR 4 #define DS34USB_SET_RUMBLE 5 -#define DS34USB_SET_LED 6 -#define DS34USB_GET_DATA 7 -#define DS34USB_RESET 8 +#define DS34USB_SET_LED 6 +#define DS34USB_GET_DATA 7 +#define DS34USB_RESET 8 #define DS34USB_BIND_RPC_ID 0x18E3878E diff --git a/modules/ds34usb/iop/ds34usb.c b/modules/ds34usb/iop/ds34usb.c index 5e813a459..e9f4e4110 100644 --- a/modules/ds34usb/iop/ds34usb.c +++ b/modules/ds34usb/iop/ds34usb.c @@ -15,7 +15,7 @@ IRX_ID("ds34usb", 1, 1); #define DPRINTF(x...) #define REQ_USB_OUT (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) -#define REQ_USB_IN (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) +#define REQ_USB_IN (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) #define MAX_PADS 2 @@ -687,14 +687,14 @@ static SifRpcServerData_t rpc_svr __attribute__((aligned(16))); static int rpc_buf[64] __attribute((aligned(16))); -#define DS34USB_INIT 1 +#define DS34USB_INIT 1 #define DS34USB_GET_STATUS 2 #define DS34USB_GET_BDADDR 3 #define DS34USB_SET_BDADDR 4 #define DS34USB_SET_RUMBLE 5 -#define DS34USB_SET_LED 6 -#define DS34USB_GET_DATA 7 -#define DS34USB_RESET 8 +#define DS34USB_SET_LED 6 +#define DS34USB_GET_DATA 7 +#define DS34USB_RESET 8 #define DS34USB_BIND_RPC_ID 0x18E3878E diff --git a/modules/ds34usb/iop/ds34usb.h b/modules/ds34usb/iop/ds34usb.h index bb913cd97..670e1fdf6 100644 --- a/modules/ds34usb/iop/ds34usb.h +++ b/modules/ds34usb/iop/ds34usb.h @@ -3,9 +3,9 @@ #include "irx.h" -#define DS34_VID 0x054C // Sony Corporation -#define DS3_PID 0x0268 // PS3 Controller -#define DS4_PID 0x05C4 // PS4 Controller +#define DS34_VID 0x054C // Sony Corporation +#define DS3_PID 0x0268 // PS3 Controller +#define DS4_PID 0x05C4 // PS4 Controller #define DS4_PID_SLIM 0x09CC // PS4 Slim Controller #define DS3 0 @@ -73,13 +73,13 @@ struct ds3report struct { u8 Select : 1; - u8 L3 : 1; - u8 R3 : 1; - u8 Start : 1; - u8 Up : 1; - u8 Right : 1; - u8 Down : 1; - u8 Left : 1; + u8 L3 : 1; + u8 R3 : 1; + u8 Start : 1; + u8 Up : 1; + u8 Right : 1; + u8 Down : 1; + u8 Left : 1; }; }; union @@ -87,14 +87,14 @@ struct ds3report u8 ButtonStateH; // Main buttons High struct { - u8 L2 : 1; - u8 R2 : 1; - u8 L1 : 1; - u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 L1 : 1; + u8 R1 : 1; u8 Triangle : 1; - u8 Circle : 1; - u8 Cross : 1; - u8 Square : 1; + u8 Circle : 1; + u8 Cross : 1; + u8 Square : 1; }; }; u8 PSButtonState; // PS button @@ -131,25 +131,25 @@ struct ds3report struct ds4report { u8 ReportID; - u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid - u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid - u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid - u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid - u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW - u8 Square : 1; - u8 Cross : 1; - u8 Circle : 1; + u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid + u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid + u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid + u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid + u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW + u8 Square : 1; + u8 Cross : 1; + u8 Circle : 1; u8 Triangle : 1; - u8 L1 : 1; - u8 R1 : 1; - u8 L2 : 1; - u8 R2 : 1; - u8 Share : 1; - u8 Option : 1; - u8 L3 : 1; - u8 R3 : 1; + u8 L1 : 1; + u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 Share : 1; + u8 Option : 1; + u8 L3 : 1; + u8 R3 : 1; u8 PSButton : 1; - u8 TPad : 1; + u8 TPad : 1; u8 Counter1 : 6; // counts up by 1 per report u8 PressureL2; // digital Pad L2 button Pressure 0 - 255 u8 PressureR2; // digital Pad R2 button Pressure 0 - 255 @@ -162,23 +162,23 @@ struct ds4report s16 GyroZ; s16 GyroY; s16 GyroX; - u8 Reserved1[5]; // Unknown - u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged + u8 Reserved1[5]; // Unknown + u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged u8 Usb_plugged : 1; - u8 Headphones : 1; - u8 Microphone : 1; - u8 Padding : 1; - u8 Reserved2[2]; // Unknown - u8 TPpack; // number of trackpad packets (0x00 to 0x04) - u8 PackCounter; // packet counter - u8 Finger1ID : 7; // counter - u8 Finger1Active : 1; // 0 - active, 1 - unactive - u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 - u16 Finger1Y : 12; - u8 Finger2ID : 7; + u8 Headphones : 1; + u8 Microphone : 1; + u8 Padding : 1; + u8 Reserved2[2]; // Unknown + u8 TPpack; // number of trackpad packets (0x00 to 0x04) + u8 PackCounter; // packet counter + u8 Finger1ID : 7; // counter + u8 Finger1Active : 1; // 0 - active, 1 - unactive + u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 + u16 Finger1Y : 12; + u8 Finger2ID : 7; u8 Finger2Active : 1; - u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 - u16 Finger2Y : 12; + u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 + u16 Finger2Y : 12; } __attribute__((packed)); diff --git a/modules/hdd/common/opl-hdd-ioctl.h b/modules/hdd/common/opl-hdd-ioctl.h index 375b8155e..adcf19727 100644 --- a/modules/hdd/common/opl-hdd-ioctl.h +++ b/modules/hdd/common/opl-hdd-ioctl.h @@ -2,7 +2,7 @@ #define OPL_HDD_IOCTL_H // Commands and structures for XATAD.IRX -#define ATA_DEVCTL_IS_48BIT 0x6840 +#define ATA_DEVCTL_IS_48BIT 0x6840 #define ATA_DEVCTL_SET_TRANSFER_MODE 0x6841 #define ATA_XFER_MODE_MDMA 0x20 diff --git a/modules/iopcore/cdvdman/atad.c b/modules/iopcore/cdvdman/atad.c index f1354821c..cace7d02f 100644 --- a/modules/iopcore/cdvdman/atad.c +++ b/modules/iopcore/cdvdman/atad.c @@ -49,7 +49,7 @@ extern int netlog_inited; } while (0) #endif -#define BANNER "ATA device driver %s - Copyright (c) 2003 Marcus R. Brown\n" +#define BANNER "ATA device driver %s - Copyright (c) 2003 Marcus R. Brown\n" #define VERSION "v1.2" extern char lba_48bit; @@ -59,10 +59,10 @@ static int ata_evflg = -1; int ata_io_sema = -1; -#define WAITIOSEMA(x) WaitSema(x) +#define WAITIOSEMA(x) WaitSema(x) #define SIGNALIOSEMA(x) SignalSema(x) -#define ATA_EV_TIMEOUT 1 +#define ATA_EV_TIMEOUT 1 #define ATA_EV_COMPLETE 2 /* Local device info. */ @@ -202,10 +202,10 @@ int ata_get_error(void) return ata_hwport->r_error & 0xff; } -#define ATA_WAIT_BUSY 0x80 +#define ATA_WAIT_BUSY 0x80 #define ATA_WAIT_BUSBUSY 0x88 -#define ata_wait_busy() gen_ata_wait_busy(ATA_WAIT_BUSY) +#define ata_wait_busy() gen_ata_wait_busy(ATA_WAIT_BUSY) #define ata_wait_bus_busy() gen_ata_wait_busy(ATA_WAIT_BUSBUSY) /* 0x80 for busy, 0x88 for bus busy. diff --git a/modules/iopcore/cdvdman/atad.h b/modules/iopcore/cdvdman/atad.h index 5b588fb20..f28f1ca96 100644 --- a/modules/iopcore/cdvdman/atad.h +++ b/modules/iopcore/cdvdman/atad.h @@ -18,10 +18,10 @@ #include /* These are used with the dir parameter of ata_device_sector_io(). */ -#define ATA_DIR_READ 0 +#define ATA_DIR_READ 0 #define ATA_DIR_WRITE 1 -#define ATAD_XFER_MODE_PIO 0x08 +#define ATAD_XFER_MODE_PIO 0x08 #define ATAD_XFER_MODE_MDMA 0x20 #define ATAD_XFER_MODE_UDMA 0x40 @@ -39,13 +39,13 @@ typedef struct _ata_devinfo /* Error definitions. */ #define ATA_RES_ERR_NOTREADY -501 -#define ATA_RES_ERR_TIMEOUT -502 -#define ATA_RES_ERR_IO -503 -#define ATA_RES_ERR_NODATA -504 -#define ATA_RES_ERR_NODEV -505 -#define ATA_RES_ERR_CMD -506 -#define ATA_RES_ERR_LOCKED -509 -#define ATA_RES_ERR_ICRC -510 +#define ATA_RES_ERR_TIMEOUT -502 +#define ATA_RES_ERR_IO -503 +#define ATA_RES_ERR_NODATA -504 +#define ATA_RES_ERR_NODEV -505 +#define ATA_RES_ERR_CMD -506 +#define ATA_RES_ERR_LOCKED -509 +#define ATA_RES_ERR_ICRC -510 int atad_start(void); ata_devinfo_t *ata_get_devinfo(int device); @@ -56,11 +56,11 @@ int ata_device_sector_io(int device, void *buf, u32 lba, u32 nsectors, int dir); int ata_device_flush_cache(int device); // APA Partition -#define APA_MAGIC 0x00415041 // 'APA\0' -#define APA_IDMAX 32 -#define APA_MAXSUB 64 // Maximum # of sub-partitions -#define APA_PASSMAX 8 -#define APA_FLAG_SUB 0x0001 +#define APA_MAGIC 0x00415041 // 'APA\0' +#define APA_IDMAX 32 +#define APA_MAXSUB 64 // Maximum # of sub-partitions +#define APA_PASSMAX 8 +#define APA_FLAG_SUB 0x0001 #define APA_MBR_VERSION 2 typedef struct diff --git a/modules/iopcore/cdvdman/cdvdman.c b/modules/iopcore/cdvdman/cdvdman.c index 22062e2a1..d23a06fe8 100644 --- a/modules/iopcore/cdvdman/cdvdman.c +++ b/modules/iopcore/cdvdman/cdvdman.c @@ -120,9 +120,9 @@ static void cdvdman_initdev(void); static int cdvdman_read(u32 lsn, u32 sectors, void *buf); // for "cdrom" ioctl2 -#define CIOCSTREAMPAUSE 0x630D +#define CIOCSTREAMPAUSE 0x630D #define CIOCSTREAMRESUME 0x630E -#define CIOCSTREAMSTAT 0x630F +#define CIOCSTREAMSTAT 0x630F // driver ops protypes static int cdrom_dummy(void); @@ -209,7 +209,7 @@ static iop_sys_clock_t gCallbackSysClock; // buffers #define CDVDMAN_BUF_SECTORS 2 -#define CDVDFSV_ALIGNMENT 64 +#define CDVDFSV_ALIGNMENT 64 static u8 cdvdman_buf[CDVDMAN_BUF_SECTORS * 2048]; static u8 cdvdman_fs_buf[CDVDMAN_FS_SECTORS * 2048 + CDVDFSV_ALIGNMENT]; diff --git a/modules/iopcore/cdvdman/dev9.c b/modules/iopcore/cdvdman/dev9.c index 52a56d987..5b90bdd56 100644 --- a/modules/iopcore/cdvdman/dev9.c +++ b/modules/iopcore/cdvdman/dev9.c @@ -41,7 +41,7 @@ extern char atad_inited; #endif #define VERSION "1.0" -#define BANNER "\nDEV9 device driver v%s - Copyright (c) 2003 Marcus R. Brown\n\n" +#define BANNER "\nDEV9 device driver v%s - Copyright (c) 2003 Marcus R. Brown\n\n" /* SSBUS registers. */ #define SSBUS_R_1418 0xbf801418 diff --git a/modules/iopcore/cdvdman/hdpro_atad.c b/modules/iopcore/cdvdman/hdpro_atad.c index 78d04536d..9edb6ceb6 100644 --- a/modules/iopcore/cdvdman/hdpro_atad.c +++ b/modules/iopcore/cdvdman/hdpro_atad.c @@ -33,39 +33,39 @@ } while (0) #endif -#define BANNER "ATA device driver for HD Pro Kit %s\n" +#define BANNER "ATA device driver for HD Pro Kit %s\n" #define VERSION "v1.0" // HD Pro Kit is mapping the 1st word in ROM0 seg as a main ATA controller, // The pseudo ATA controller registers are accessed (input/ouput) by writing // an id to the main ATA controller (id specific to HDpro, see registers id below). -#define HDPROreg_IO8 (*(vu8 *)0xBFC00000) +#define HDPROreg_IO8 (*(vu8 *)0xBFC00000) #define HDPROreg_IO32 (*(vu32 *)0xBFC00000) #define CDVDreg_STATUS (*(vu8 *)0xBF40200A) // Pseudo ATA controller registers id - Output #define ATAreg_CONTROL_RD 0x68 -#define ATAreg_SELECT_RD 0x70 -#define ATAreg_STATUS_RD 0xf0 -#define ATAreg_ERROR_RD 0x90 +#define ATAreg_SELECT_RD 0x70 +#define ATAreg_STATUS_RD 0xf0 +#define ATAreg_ERROR_RD 0x90 #define ATAreg_NSECTOR_RD 0x50 -#define ATAreg_SECTOR_RD 0xd0 -#define ATAreg_LCYL_RD 0x30 -#define ATAreg_HCYL_RD 0xb0 -#define ATAreg_DATA_RD 0x41 +#define ATAreg_SECTOR_RD 0xd0 +#define ATAreg_LCYL_RD 0x30 +#define ATAreg_HCYL_RD 0xb0 +#define ATAreg_DATA_RD 0x41 // Pseudo ATA controller registers id - Input #define ATAreg_CONTROL_WR 0x6a -#define ATAreg_SELECT_WR 0x72 +#define ATAreg_SELECT_WR 0x72 #define ATAreg_COMMAND_WR 0xf2 #define ATAreg_FEATURE_WR 0x92 #define ATAreg_NSECTOR_WR 0x52 -#define ATAreg_SECTOR_WR 0xd2 -#define ATAreg_LCYL_WR 0x32 -#define ATAreg_HCYL_WR 0xb2 -#define ATAreg_DATA_WR 0x12 +#define ATAreg_SECTOR_WR 0xd2 +#define ATAreg_LCYL_WR 0x32 +#define ATAreg_HCYL_WR 0xb2 +#define ATAreg_DATA_WR 0x12 static int ata_evflg = -1; @@ -74,10 +74,10 @@ extern char lba_48bit; int ata_io_sema = -1; -#define WAITIOSEMA(x) WaitSema(x) +#define WAITIOSEMA(x) WaitSema(x) #define SIGNALIOSEMA(x) SignalSema(x) -#define ATA_EV_TIMEOUT 1 +#define ATA_EV_TIMEOUT 1 #define ATA_EV_COMPLETE 2 //Unused as there is no completion interrupt /* Local device info. */ @@ -202,10 +202,10 @@ int ata_get_error() return hdpro_io_read(ATAreg_ERROR_RD) & 0xff; } -#define ATA_WAIT_BUSY 0x80 +#define ATA_WAIT_BUSY 0x80 #define ATA_WAIT_BUSBUSY 0x88 -#define ata_wait_busy() gen_ata_wait_busy(ATA_WAIT_BUSY) +#define ata_wait_busy() gen_ata_wait_busy(ATA_WAIT_BUSY) #define ata_wait_bus_busy() gen_ata_wait_busy(ATA_WAIT_BUSBUSY) /* 0x80 for busy, 0x88 for bus busy. diff --git a/modules/iopcore/cdvdman/internal.h b/modules/iopcore/cdvdman/internal.h index 55e11e0cf..4952de924 100644 --- a/modules/iopcore/cdvdman/internal.h +++ b/modules/iopcore/cdvdman/internal.h @@ -1,5 +1,5 @@ #ifdef __IOPCORE_DEBUG -#define DPRINTF(args...) printf(args) +#define DPRINTF(args...) printf(args) #define iDPRINTF(args...) Kprintf(args) #else #define DPRINTF(args...) diff --git a/modules/iopcore/cdvdman/smb.c b/modules/iopcore/cdvdman/smb.c index 9a529cdae..f08cba0a8 100644 --- a/modules/iopcore/cdvdman/smb.c +++ b/modules/iopcore/cdvdman/smb.c @@ -28,13 +28,13 @@ This is because the IOP cannot clear the received frames fast enough, causing the number of bytes in flight to grow exponentially. The TCP congestion avoidence algorithm may induce some latency, causing extremely poor performance. The value to use should be smaller than the TCP window size. Right now, it is 10240 (according to lwipopts.h). */ -#define CLIENT_MAX_BUFFER_SIZE 8192 //Allow up to 8192 bytes to be received. -#define CLIENT_MAX_XMIT_SIZE USHRT_MAX //Allow up to 65535 bytes to be transmitted. -#define CLIENT_MAX_RECV_SIZE 8192 //Allow up to 8192 bytes to be received. +#define CLIENT_MAX_BUFFER_SIZE 8192 //Allow up to 8192 bytes to be received. +#define CLIENT_MAX_XMIT_SIZE USHRT_MAX //Allow up to 65535 bytes to be transmitted. +#define CLIENT_MAX_RECV_SIZE 8192 //Allow up to 8192 bytes to be received. int smb_io_sema = -1; -#define WAITIOSEMA(x) WaitSema(x) +#define WAITIOSEMA(x) WaitSema(x) #define SIGNALIOSEMA(x) SignalSema(x) // !!! ps2ip exports functions pointers !!! @@ -56,7 +56,7 @@ static u8 nb_GetPacketType(void); // Read message type static server_specs_t server_specs; -#define LM_AUTH 0 +#define LM_AUTH 0 #define NTLM_AUTH 1 static u16 UID, TID; diff --git a/modules/iopcore/cdvdman/smb.h b/modules/iopcore/cdvdman/smb.h index 05f4da6f5..4bd847531 100644 --- a/modules/iopcore/cdvdman/smb.h +++ b/modules/iopcore/cdvdman/smb.h @@ -13,263 +13,263 @@ #define SMB_HDR_SIZE 32 // FLAGS field bitmasks -#define SMB_FLAGS_SERVER_TO_REDIR 0x80 +#define SMB_FLAGS_SERVER_TO_REDIR 0x80 #define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40 -#define SMB_FLAGS_REQUEST_OPLOCK 0x20 -#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10 -#define SMB_FLAGS_CASELESS_PATHNAMES 0x08 -#define SMB_FLAGS_RESERVED 0x04 -#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02 -#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01 -#define SMB_FLAGS_MASK 0x00 +#define SMB_FLAGS_REQUEST_OPLOCK 0x20 +#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10 +#define SMB_FLAGS_CASELESS_PATHNAMES 0x08 +#define SMB_FLAGS_RESERVED 0x04 +#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02 +#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01 +#define SMB_FLAGS_MASK 0x00 // FLAGS2 field bitmasks -#define SMB_FLAGS2_UNICODE_STRING 0x8000 -#define SMB_FLAGS2_32BIT_STATUS 0x4000 -#define SMB_FLAGS2_READ_IF_EXECUTE 0x2000 -#define SMB_FLAGS2_DFS_PATHNAME 0x1000 -#define SMB_FLAGS2_EXTENDED_SECURITY 0x0800 -#define SMB_FLAGS2_RESERVED_01 0x0400 -#define SMB_FLAGS2_RESERVED_02 0x0200 -#define SMB_FLAGS2_RESERVED_03 0x0100 -#define SMB_FLAGS2_RESERVED_04 0x0080 -#define SMB_FLAGS2_IS_LONG_NAME 0x0040 -#define SMB_FLAGS2_RESERVED_05 0x0020 -#define SMB_FLAGS2_RESERVED_06 0x0010 -#define SMB_FLAGS2_RESERVED_07 0x0008 +#define SMB_FLAGS2_UNICODE_STRING 0x8000 +#define SMB_FLAGS2_32BIT_STATUS 0x4000 +#define SMB_FLAGS2_READ_IF_EXECUTE 0x2000 +#define SMB_FLAGS2_DFS_PATHNAME 0x1000 +#define SMB_FLAGS2_EXTENDED_SECURITY 0x0800 +#define SMB_FLAGS2_RESERVED_01 0x0400 +#define SMB_FLAGS2_RESERVED_02 0x0200 +#define SMB_FLAGS2_RESERVED_03 0x0100 +#define SMB_FLAGS2_RESERVED_04 0x0080 +#define SMB_FLAGS2_IS_LONG_NAME 0x0040 +#define SMB_FLAGS2_RESERVED_05 0x0020 +#define SMB_FLAGS2_RESERVED_06 0x0010 +#define SMB_FLAGS2_RESERVED_07 0x0008 #define SMB_FLAGS2_SECURITY_SIGNATURE 0x0004 -#define SMB_FLAGS2_EAS 0x0002 -#define SMB_FLAGS2_KNOWS_LONG_NAMES 0x0001 -#define SMB_FLAGS2_MASK 0xf847 +#define SMB_FLAGS2_EAS 0x0002 +#define SMB_FLAGS2_KNOWS_LONG_NAMES 0x0001 +#define SMB_FLAGS2_MASK 0xf847 // Field offsets -#define SMB_OFFSET_CMD 4 -#define SMB_OFFSET_NTSTATUS 5 -#define SMB_OFFSET_ECLASS 5 -#define SMB_OFFSET_ECODE 7 -#define SMB_OFFSET_FLAGS 9 -#define SMB_OFFSET_FLAGS2 10 -#define SMB_OFFSET_EXTRA 12 -#define SMB_OFFSET_TID 24 -#define SMB_OFFSET_PID 26 -#define SMB_OFFSET_UID 28 -#define SMB_OFFSET_MID 30 -#define SMB_OFFSET_WORDCOUNT 32 -#define SMB_OFFSET_ANDX_CMD 33 +#define SMB_OFFSET_CMD 4 +#define SMB_OFFSET_NTSTATUS 5 +#define SMB_OFFSET_ECLASS 5 +#define SMB_OFFSET_ECODE 7 +#define SMB_OFFSET_FLAGS 9 +#define SMB_OFFSET_FLAGS2 10 +#define SMB_OFFSET_EXTRA 12 +#define SMB_OFFSET_TID 24 +#define SMB_OFFSET_PID 26 +#define SMB_OFFSET_UID 28 +#define SMB_OFFSET_MID 30 +#define SMB_OFFSET_WORDCOUNT 32 +#define SMB_OFFSET_ANDX_CMD 33 #define SMB_OFFSET_ANDX_RESERVED 34 -#define SMB_OFFSET_ANDX_OFFSET 35 +#define SMB_OFFSET_ANDX_OFFSET 35 // Transaction2 Request Field offsets #define SMB_TRANS2_REQ_OFFSET_TOTALPARAMCOUNT 33 -#define SMB_TRANS2_REQ_OFFSET_TOTALDATACOUNT 35 -#define SMB_TRANS2_REQ_OFFSET_MAXPARAMCOUNT 37 -#define SMB_TRANS2_REQ_OFFSET_MAXDATACOUNT 39 -#define SMB_TRANS2_REQ_OFFSET_MAXSETUPCOUNT 41 -#define SMB_TRANS2_REQ_OFFSET_RESERVED 42 -#define SMB_TRANS2_REQ_OFFSET_FLAGS 43 -#define SMB_TRANS2_REQ_OFFSET_TIMEOUT 45 -#define SMB_TRANS2_REQ_OFFSET_RESERVED2 49 -#define SMB_TRANS2_REQ_OFFSET_PARAMCOUNT 51 -#define SMB_TRANS2_REQ_OFFSET_PARAMOFFSET 53 -#define SMB_TRANS2_REQ_OFFSET_DATACOUNT 55 -#define SMB_TRANS2_REQ_OFFSET_DATAOFFSET 57 -#define SMB_TRANS2_REQ_OFFSET_SETUPCOUNT 59 -#define SMB_TRANS2_REQ_OFFSET_RESERVED3 60 -#define SMB_TRANS2_REQ_OFFSET_SETUP0 61 +#define SMB_TRANS2_REQ_OFFSET_TOTALDATACOUNT 35 +#define SMB_TRANS2_REQ_OFFSET_MAXPARAMCOUNT 37 +#define SMB_TRANS2_REQ_OFFSET_MAXDATACOUNT 39 +#define SMB_TRANS2_REQ_OFFSET_MAXSETUPCOUNT 41 +#define SMB_TRANS2_REQ_OFFSET_RESERVED 42 +#define SMB_TRANS2_REQ_OFFSET_FLAGS 43 +#define SMB_TRANS2_REQ_OFFSET_TIMEOUT 45 +#define SMB_TRANS2_REQ_OFFSET_RESERVED2 49 +#define SMB_TRANS2_REQ_OFFSET_PARAMCOUNT 51 +#define SMB_TRANS2_REQ_OFFSET_PARAMOFFSET 53 +#define SMB_TRANS2_REQ_OFFSET_DATACOUNT 55 +#define SMB_TRANS2_REQ_OFFSET_DATAOFFSET 57 +#define SMB_TRANS2_REQ_OFFSET_SETUPCOUNT 59 +#define SMB_TRANS2_REQ_OFFSET_RESERVED3 60 +#define SMB_TRANS2_REQ_OFFSET_SETUP0 61 // Transaction2 Response Field offsets -#define SMB_TRANS2_RSP_OFFSET_TOTALPARAMCOUNT 33 -#define SMB_TRANS2_RSP_OFFSET_TOTALDATACOUNT 35 -#define SMB_TRANS2_RSP_OFFSET_RESERVED 37 -#define SMB_TRANS2_RSP_OFFSET_PARAMCOUNT 39 -#define SMB_TRANS2_RSP_OFFSET_PARAMOFFSET 41 +#define SMB_TRANS2_RSP_OFFSET_TOTALPARAMCOUNT 33 +#define SMB_TRANS2_RSP_OFFSET_TOTALDATACOUNT 35 +#define SMB_TRANS2_RSP_OFFSET_RESERVED 37 +#define SMB_TRANS2_RSP_OFFSET_PARAMCOUNT 39 +#define SMB_TRANS2_RSP_OFFSET_PARAMOFFSET 41 #define SMB_TRANS2_RSP_OFFSET_PARAMDISPLACEMENT 43 -#define SMB_TRANS2_RSP_OFFSET_DATACOUNT 45 -#define SMB_TRANS2_RSP_OFFSET_DATAOFFSET 47 -#define SMB_TRANS2_RSP_OFFSET_DATADISPLACEMENT 49 -#define SMB_TRANS2_RSP_OFFSET_SETUPCOUNT 51 -#define SMB_TRANS2_RSP_OFFSET_RESERVED2 52 -#define SMB_TRANS2_RSP_OFFSET_BYTECOUNT 53 -#define SMB_TRANS2_RSP_OFFSET_PAD 55 +#define SMB_TRANS2_RSP_OFFSET_DATACOUNT 45 +#define SMB_TRANS2_RSP_OFFSET_DATAOFFSET 47 +#define SMB_TRANS2_RSP_OFFSET_DATADISPLACEMENT 49 +#define SMB_TRANS2_RSP_OFFSET_SETUPCOUNT 51 +#define SMB_TRANS2_RSP_OFFSET_RESERVED2 52 +#define SMB_TRANS2_RSP_OFFSET_BYTECOUNT 53 +#define SMB_TRANS2_RSP_OFFSET_PAD 55 // SMB File Attributes Encoding (16-bit) -#define ATTR_READONLY 0x01 -#define ATTR_HIDDEN 0x02 -#define ATTR_SYSTEM 0x04 -#define ATTR_VOLUME 0x08 +#define ATTR_READONLY 0x01 +#define ATTR_HIDDEN 0x02 +#define ATTR_SYSTEM 0x04 +#define ATTR_VOLUME 0x08 #define ATTR_DIRECTORY 0x10 -#define ATTR_ARCHIVE 0x20 +#define ATTR_ARCHIVE 0x20 // SMB Extended File Attributes Encoding (32-bit) -#define EXT_ATTR_READONLY 0x001 -#define EXT_ATTR_HIDDEN 0x002 -#define EXT_ATTR_SYSTEM 0x004 -#define EXT_ATTR_DIRECTORY 0x010 -#define EXT_ATTR_ARCHIVE 0x020 -#define EXT_ATTR_NORMAL 0x080 -#define EXT_ATTR_TEMPORARY 0x100 +#define EXT_ATTR_READONLY 0x001 +#define EXT_ATTR_HIDDEN 0x002 +#define EXT_ATTR_SYSTEM 0x004 +#define EXT_ATTR_DIRECTORY 0x010 +#define EXT_ATTR_ARCHIVE 0x020 +#define EXT_ATTR_NORMAL 0x080 +#define EXT_ATTR_TEMPORARY 0x100 #define EXT_ATTR_COMPRESSED 0x800 // SMB Information Level -#define SMB_INFO_STANDARD 0x001 -#define SMB_INFO_QUERY_EA_SIZE 0x002 -#define SMB_INFO_QUERY_EAS_FROM_LIST 0x003 -#define SMB_FIND_FILE_DIRECTORY_INFO 0x101 +#define SMB_INFO_STANDARD 0x001 +#define SMB_INFO_QUERY_EA_SIZE 0x002 +#define SMB_INFO_QUERY_EAS_FROM_LIST 0x003 +#define SMB_FIND_FILE_DIRECTORY_INFO 0x101 #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102 -#define SMB_FIND_FILE_NAMES_INFO 0x103 +#define SMB_FIND_FILE_NAMES_INFO 0x103 #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104 -#define SMB_FIND_FILE_UNIX 0x202 +#define SMB_FIND_FILE_UNIX 0x202 // SMB Search Flags #define CLOSE_SEARCH_AFTER_REQUEST 0x01 -#define CLOSE_SEARCH_IF_EOS 0x02 -#define RESUME_SEARCH 0x04 -#define CONTINUE_SEARCH 0x08 -#define BACKUP_INTENT_SEARCH 0x10 +#define CLOSE_SEARCH_IF_EOS 0x02 +#define RESUME_SEARCH 0x04 +#define CONTINUE_SEARCH 0x08 +#define BACKUP_INTENT_SEARCH 0x10 // SMB Server Capabilities -#define SERVER_CAP_EXTENDED_SECURITY 0x80000000 -#define SERVER_CAP_COMPRESSED_DATA 0x40000000 -#define SERVER_CAP_BULK_TRANSFER 0x20000000 -#define SERVER_CAP_UNIX 0x00800000 -#define SERVER_CAP_LARGE_WRITEX 0x00008000 -#define SERVER_CAP_LARGE_READX 0x00004000 +#define SERVER_CAP_EXTENDED_SECURITY 0x80000000 +#define SERVER_CAP_COMPRESSED_DATA 0x40000000 +#define SERVER_CAP_BULK_TRANSFER 0x20000000 +#define SERVER_CAP_UNIX 0x00800000 +#define SERVER_CAP_LARGE_WRITEX 0x00008000 +#define SERVER_CAP_LARGE_READX 0x00004000 #define SERVER_CAP_INFOLEVEL_PASSTHROUGH 0x00002000 -#define SERVER_CAP_DFS 0x00001000 -#define SERVER_CAP_NT_FIND 0x00000200 -#define SERVER_CAP_LOCK_AND_READ 0x00000100 -#define SERVER_CAP_LEVEL_II_OPLOCKS 0x00000080 -#define SERVER_CAP_STATUS32 0x00000040 -#define SERVER_CAP_RPC_REMOTE_APIS 0x00000020 -#define SERVER_CAP_NT_SMBS 0x00000010 -#define SERVER_CAP_LARGE_FILES 0x00000008 -#define SERVER_CAP_UNICODE 0x00000004 -#define SERVER_CAP_MPX_MODE 0x00000002 -#define SERVER_CAP_RAW_MODE 0x00000001 +#define SERVER_CAP_DFS 0x00001000 +#define SERVER_CAP_NT_FIND 0x00000200 +#define SERVER_CAP_LOCK_AND_READ 0x00000100 +#define SERVER_CAP_LEVEL_II_OPLOCKS 0x00000080 +#define SERVER_CAP_STATUS32 0x00000040 +#define SERVER_CAP_RPC_REMOTE_APIS 0x00000020 +#define SERVER_CAP_NT_SMBS 0x00000010 +#define SERVER_CAP_LARGE_FILES 0x00000008 +#define SERVER_CAP_UNICODE 0x00000004 +#define SERVER_CAP_MPX_MODE 0x00000002 +#define SERVER_CAP_RAW_MODE 0x00000001 // SMB Client Capabilities #define CLIENT_CAP_EXTENDED_SECURITY SERVER_CAP_EXTENDED_SECURITY -#define CLIENT_CAP_LARGE_WRITEX SERVER_CAP_LARGE_WRITEX -#define CLIENT_CAP_LARGE_READX SERVER_CAP_LARGE_READX -#define CLIENT_CAP_NT_FIND SERVER_CAP_NT_FIND -#define CLIENT_CAP_LEVEL_II_OPLOCKS SERVER_CAP_LEVEL_II_OPLOCKS -#define CLIENT_CAP_STATUS32 SERVER_CAP_STATUS32 -#define CLIENT_CAP_NT_SMBS SERVER_CAP_NT_SMBS -#define CLIENT_CAP_LARGE_FILES SERVER_CAP_LARGE_FILES -#define CLIENT_CAP_UNICODE SERVER_CAP_UNICODE +#define CLIENT_CAP_LARGE_WRITEX SERVER_CAP_LARGE_WRITEX +#define CLIENT_CAP_LARGE_READX SERVER_CAP_LARGE_READX +#define CLIENT_CAP_NT_FIND SERVER_CAP_NT_FIND +#define CLIENT_CAP_LEVEL_II_OPLOCKS SERVER_CAP_LEVEL_II_OPLOCKS +#define CLIENT_CAP_STATUS32 SERVER_CAP_STATUS32 +#define CLIENT_CAP_NT_SMBS SERVER_CAP_NT_SMBS +#define CLIENT_CAP_LARGE_FILES SERVER_CAP_LARGE_FILES +#define CLIENT_CAP_UNICODE SERVER_CAP_UNICODE // Security Modes #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08 -#define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04 -#define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x02 -#define NEGOTIATE_SECURITY_USER_LEVEL 0x01 +#define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04 +#define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x02 +#define NEGOTIATE_SECURITY_USER_LEVEL 0x01 // SMB Commands -#define SMB_COM_CREATE_DIRECTORY 0x00 -#define SMB_COM_DELETE_DIRECTORY 0x01 -#define SMB_COM_OPEN 0x02 -#define SMB_COM_CREATE 0x03 -#define SMB_COM_CLOSE 0x04 -#define SMB_COM_FLUSH 0x05 -#define SMB_COM_DELETE 0x06 -#define SMB_COM_RENAME 0x07 -#define SMB_COM_QUERY_INFORMATION 0x08 -#define SMB_COM_SET_INFORMATION 0x09 -#define SMB_COM_READ 0x0a -#define SMB_COM_WRITE 0x0b -#define SMB_COM_LOCK_BYTE_RANGE 0x0c -#define SMB_COM_UNLOCK_BYTE_RANGE 0x0d -#define SMB_COM_CREATE_TEMPORARY 0x0e -#define SMB_COM_CREATE_NEW 0x0f -#define SMB_COM_CHECK_DIRECTORY 0x10 -#define SMB_COM_PROCESS_EXIT 0x11 -#define SMB_COM_SEEK 0x12 -#define SMB_COM_LOCK_AND_READ 0x13 -#define SMB_COM_WRITE_AND_UNLOCK 0x14 -#define SMB_COM_READ_RAW 0x1a -#define SMB_COM_READ_MPX 0x1b -#define SMB_COM_READ_MPX_SECONDARY 0x1c -#define SMB_COM_WRITE_RAW 0x1d -#define SMB_COM_WRITE_MPX 0x1e -#define SMB_COM_WRITE_MPX_SECONDARY 0x1f -#define SMB_COM_WRITE_COMPLETE 0x20 -#define SMB_COM_QUERY_SERVER 0x21 -#define SMB_COM_SET_INFORMATION2 0x22 -#define SMB_COM_QUERY_INFORMATION2 0x23 -#define SMB_COM_LOCKING_ANDX 0x24 -#define SMB_COM_TRANSACTION 0x25 -#define SMB_COM_TRANSACTION_SECONDARY 0x26 -#define SMB_COM_IOCTL 0x27 -#define SMB_COM_IOCTL_SECONDARY 0x28 -#define SMB_COM_COPY 0x29 -#define SMB_COM_MOVE 0x2a -#define SMB_COM_ECHO 0x2b -#define SMB_COM_WRITE_AND_CLOSE 0x2c -#define SMB_COM_OPEN_ANDX 0x2d -#define SMB_COM_READ_ANDX 0x2e -#define SMB_COM_WRITE_ANDX 0x2f -#define SMB_COM_NEW_FILE_SIZE 0x30 -#define SMB_COM_CLOSE_AND_TREE_DISC 0x31 -#define SMB_COM_TRANSACTION2 0x32 +#define SMB_COM_CREATE_DIRECTORY 0x00 +#define SMB_COM_DELETE_DIRECTORY 0x01 +#define SMB_COM_OPEN 0x02 +#define SMB_COM_CREATE 0x03 +#define SMB_COM_CLOSE 0x04 +#define SMB_COM_FLUSH 0x05 +#define SMB_COM_DELETE 0x06 +#define SMB_COM_RENAME 0x07 +#define SMB_COM_QUERY_INFORMATION 0x08 +#define SMB_COM_SET_INFORMATION 0x09 +#define SMB_COM_READ 0x0a +#define SMB_COM_WRITE 0x0b +#define SMB_COM_LOCK_BYTE_RANGE 0x0c +#define SMB_COM_UNLOCK_BYTE_RANGE 0x0d +#define SMB_COM_CREATE_TEMPORARY 0x0e +#define SMB_COM_CREATE_NEW 0x0f +#define SMB_COM_CHECK_DIRECTORY 0x10 +#define SMB_COM_PROCESS_EXIT 0x11 +#define SMB_COM_SEEK 0x12 +#define SMB_COM_LOCK_AND_READ 0x13 +#define SMB_COM_WRITE_AND_UNLOCK 0x14 +#define SMB_COM_READ_RAW 0x1a +#define SMB_COM_READ_MPX 0x1b +#define SMB_COM_READ_MPX_SECONDARY 0x1c +#define SMB_COM_WRITE_RAW 0x1d +#define SMB_COM_WRITE_MPX 0x1e +#define SMB_COM_WRITE_MPX_SECONDARY 0x1f +#define SMB_COM_WRITE_COMPLETE 0x20 +#define SMB_COM_QUERY_SERVER 0x21 +#define SMB_COM_SET_INFORMATION2 0x22 +#define SMB_COM_QUERY_INFORMATION2 0x23 +#define SMB_COM_LOCKING_ANDX 0x24 +#define SMB_COM_TRANSACTION 0x25 +#define SMB_COM_TRANSACTION_SECONDARY 0x26 +#define SMB_COM_IOCTL 0x27 +#define SMB_COM_IOCTL_SECONDARY 0x28 +#define SMB_COM_COPY 0x29 +#define SMB_COM_MOVE 0x2a +#define SMB_COM_ECHO 0x2b +#define SMB_COM_WRITE_AND_CLOSE 0x2c +#define SMB_COM_OPEN_ANDX 0x2d +#define SMB_COM_READ_ANDX 0x2e +#define SMB_COM_WRITE_ANDX 0x2f +#define SMB_COM_NEW_FILE_SIZE 0x30 +#define SMB_COM_CLOSE_AND_TREE_DISC 0x31 +#define SMB_COM_TRANSACTION2 0x32 #define SMB_COM_TRANSACTION2_SECONDARY 0x33 -#define SMB_COM_FIND_CLOSE2 0x34 -#define SMB_COM_FIND_NOTIFY_CLOSE 0x35 -#define SMB_COM_TREE_CONNECT 0x70 -#define SMB_COM_TREE_DISCONNECT 0x71 -#define SMB_COM_NEGOTIATE 0x72 -#define SMB_COM_SESSION_SETUP_ANDX 0x73 -#define SMB_COM_LOGOFF_ANDX 0x74 -#define SMB_COM_TREE_CONNECT_ANDX 0x75 +#define SMB_COM_FIND_CLOSE2 0x34 +#define SMB_COM_FIND_NOTIFY_CLOSE 0x35 +#define SMB_COM_TREE_CONNECT 0x70 +#define SMB_COM_TREE_DISCONNECT 0x71 +#define SMB_COM_NEGOTIATE 0x72 +#define SMB_COM_SESSION_SETUP_ANDX 0x73 +#define SMB_COM_LOGOFF_ANDX 0x74 +#define SMB_COM_TREE_CONNECT_ANDX 0x75 #define SMB_COM_QUERY_INFORMATION_DISK 0x80 -#define SMB_COM_SEARCH 0x81 -#define SMB_COM_FIND 0x82 -#define SMB_COM_FIND_UNIQUE 0x83 -#define SMB_COM_FIND_CLOSE 0x84 -#define SMB_COM_NT_TRANSACT 0xa0 -#define SMB_COM_NT_TRANSACT_SECONDARY 0xa1 -#define SMB_COM_NT_CREATE_ANDX 0xa2 -#define SMB_COM_NT_CANCEL 0xa4 -#define SMB_COM_NT_RENAME 0xa5 -#define SMB_COM_OPEN_PRINT_FILE 0xc0 -#define SMB_COM_WRITE_PRINT_FILE 0xc1 -#define SMB_COM_CLOSE_PRINT_FILE 0xc2 -#define SMB_COM_GET_PRINT_QUEUE 0xc3 -#define SMB_COM_READ_BULK 0xd8 -#define SMB_COM_WRITE_BULK 0xd9 -#define SMB_COM_WRITE_BULK_DATA 0xda -#define SMB_COM_NONE 0xff +#define SMB_COM_SEARCH 0x81 +#define SMB_COM_FIND 0x82 +#define SMB_COM_FIND_UNIQUE 0x83 +#define SMB_COM_FIND_CLOSE 0x84 +#define SMB_COM_NT_TRANSACT 0xa0 +#define SMB_COM_NT_TRANSACT_SECONDARY 0xa1 +#define SMB_COM_NT_CREATE_ANDX 0xa2 +#define SMB_COM_NT_CANCEL 0xa4 +#define SMB_COM_NT_RENAME 0xa5 +#define SMB_COM_OPEN_PRINT_FILE 0xc0 +#define SMB_COM_WRITE_PRINT_FILE 0xc1 +#define SMB_COM_CLOSE_PRINT_FILE 0xc2 +#define SMB_COM_GET_PRINT_QUEUE 0xc3 +#define SMB_COM_READ_BULK 0xd8 +#define SMB_COM_WRITE_BULK 0xd9 +#define SMB_COM_WRITE_BULK_DATA 0xda +#define SMB_COM_NONE 0xff // Setup[0] Transaction2 Subcommands -#define TRANS2_OPEN2 0x00 -#define TRANS2_FIND_FIRST2 0x01 -#define TRANS2_FIND_NEXT2 0x02 -#define TRANS2_QUERY_FS_INFORMATION 0x03 -#define TRANS2_SET_FS_INFORMATION 0x04 -#define TRANS2_QUERY_PATH_INFORMATION 0X05 -#define TRANS2_SET_PATH_INFORMATION 0x06 -#define TRANS2_QUERY_FILE_INFORMATION 0x07 -#define TRANS2_SET_FILE_INFORMATION 0x08 -#define TRANS2_FSCTL 0x09 -#define TRANS2_IOCTL2 0x0a -#define TRANS2_FIND_NOTIFY_FIRST 0x0b -#define TRANS2_FIND_NOTIFY_NEXT 0x0c -#define TRANS2_CREATE_DIRECTORY 0x0d -#define TRANS2_SESSION_SETUP 0x0e -#define TRANS2_GET_DFS_REFERRAL 0x10 +#define TRANS2_OPEN2 0x00 +#define TRANS2_FIND_FIRST2 0x01 +#define TRANS2_FIND_NEXT2 0x02 +#define TRANS2_QUERY_FS_INFORMATION 0x03 +#define TRANS2_SET_FS_INFORMATION 0x04 +#define TRANS2_QUERY_PATH_INFORMATION 0X05 +#define TRANS2_SET_PATH_INFORMATION 0x06 +#define TRANS2_QUERY_FILE_INFORMATION 0x07 +#define TRANS2_SET_FILE_INFORMATION 0x08 +#define TRANS2_FSCTL 0x09 +#define TRANS2_IOCTL2 0x0a +#define TRANS2_FIND_NOTIFY_FIRST 0x0b +#define TRANS2_FIND_NOTIFY_NEXT 0x0c +#define TRANS2_CREATE_DIRECTORY 0x0d +#define TRANS2_SESSION_SETUP 0x0e +#define TRANS2_GET_DFS_REFERRAL 0x10 #define TRANS2_REPORT_DFS_INCONSISTENCY 0x11 // DOS Error Class #define DOS_ECLASS_SUCCESS 0x00 // NT Status -#define STATUS_SUCCESS 0x00000000 -#define STATUS_NO_MEDIA_IN_DEVICE 0xc0000013 -#define STATUS_ACCESS_DENIED 0xc0000022 +#define STATUS_SUCCESS 0x00000000 +#define STATUS_NO_MEDIA_IN_DEVICE 0xc0000013 +#define STATUS_ACCESS_DENIED 0xc0000022 #define STATUS_OBJECT_NAME_NOT_FOUND 0xc0000034 -#define STATUS_LOGON_FAILURE 0xc000006d +#define STATUS_LOGON_FAILURE 0xc000006d -#define SERVER_SHARE_SECURITY_LEVEL 0 -#define SERVER_USER_SECURITY_LEVEL 1 +#define SERVER_SHARE_SECURITY_LEVEL 0 +#define SERVER_USER_SECURITY_LEVEL 1 #define SERVER_USE_PLAINTEXT_PASSWORD 0 #define SERVER_USE_ENCRYPTED_PASSWORD 1 @@ -509,7 +509,7 @@ int smb_ReadCD(unsigned int lsn, unsigned int nsectors, void *buf, int part_num) void smb_CloseAll(void); int smb_Disconnect(void); -#define MAX_SMB_BUF 896 // must fit on u16 !!! +#define MAX_SMB_BUF 896 // must fit on u16 !!! #define MAX_SMB_BUF_HDR 128 //Must be at least as large as the largest header structure. #endif diff --git a/modules/iopcore/common/cdvd_config.h b/modules/iopcore/common/cdvd_config.h index f6cf1b3f2..73f94ad9d 100644 --- a/modules/iopcore/common/cdvd_config.h +++ b/modules/iopcore/common/cdvd_config.h @@ -1,9 +1,9 @@ -#define IOPCORE_COMPAT_ALT_READ 0x0001 +#define IOPCORE_COMPAT_ALT_READ 0x0001 #define IOPCORE_COMPAT_0_SKIP_VIDEOS 0x0002 -#define IOPCORE_COMPAT_EMU_DVDDL 0x0004 -#define IOPCORE_COMPAT_ACCU_READS 0x0008 -#define IOPCORE_ENABLE_POFF 0x0100 -#define IOPCORE_SMB_FORMAT_USBLD 0x0200 +#define IOPCORE_COMPAT_EMU_DVDDL 0x0004 +#define IOPCORE_COMPAT_ACCU_READS 0x0008 +#define IOPCORE_ENABLE_POFF 0x0100 +#define IOPCORE_SMB_FORMAT_USBLD 0x0200 #define ISO_MAX_PARTS 10 diff --git a/modules/iopcore/common/cdvdman.h b/modules/iopcore/common/cdvdman.h index a76530e04..b30cffb42 100644 --- a/modules/iopcore/common/cdvdman.h +++ b/modules/iopcore/common/cdvdman.h @@ -1,61 +1,61 @@ // PS2 CDVD hardware registers -#define CDL_DATA_RDY 0x01 +#define CDL_DATA_RDY 0x01 #define CDL_DATA_COMPLETE 0x02 -#define CDL_DATA_END 0x04 +#define CDL_DATA_END 0x04 #define CDVDreg_NCOMMAND (*(volatile unsigned char *)0xBF402004) -#define CDVDreg_READY (*(volatile unsigned char *)0xBF402005) -#define CDVDreg_NDATAIN (*(volatile unsigned char *)0xBF402005) -#define CDVDreg_ERROR (*(volatile unsigned char *)0xBF402006) -#define CDVDreg_HOWTO (*(volatile unsigned char *)0xBF402006) -#define CDVDreg_ABORT (*(volatile unsigned char *)0xBF402007) -#define CDVDreg_PWOFF (*(volatile unsigned char *)0xBF402008) -#define CDVDreg_9 (*(volatile unsigned char *)0xBF402009) -#define CDVDreg_STATUS (*(volatile unsigned char *)0xBF40200A) -#define CDVDreg_B (*(volatile unsigned char *)0xBF40200B) -#define CDVDreg_C (*(volatile unsigned char *)0xBF40200C) -#define CDVDreg_D (*(volatile unsigned char *)0xBF40200D) -#define CDVDreg_E (*(volatile unsigned char *)0xBF40200E) -#define CDVDreg_TYPE (*(volatile unsigned char *)0xBF40200F) -#define CDVDreg_13 (*(volatile unsigned char *)0xBF402013) +#define CDVDreg_READY (*(volatile unsigned char *)0xBF402005) +#define CDVDreg_NDATAIN (*(volatile unsigned char *)0xBF402005) +#define CDVDreg_ERROR (*(volatile unsigned char *)0xBF402006) +#define CDVDreg_HOWTO (*(volatile unsigned char *)0xBF402006) +#define CDVDreg_ABORT (*(volatile unsigned char *)0xBF402007) +#define CDVDreg_PWOFF (*(volatile unsigned char *)0xBF402008) +#define CDVDreg_9 (*(volatile unsigned char *)0xBF402009) +#define CDVDreg_STATUS (*(volatile unsigned char *)0xBF40200A) +#define CDVDreg_B (*(volatile unsigned char *)0xBF40200B) +#define CDVDreg_C (*(volatile unsigned char *)0xBF40200C) +#define CDVDreg_D (*(volatile unsigned char *)0xBF40200D) +#define CDVDreg_E (*(volatile unsigned char *)0xBF40200E) +#define CDVDreg_TYPE (*(volatile unsigned char *)0xBF40200F) +#define CDVDreg_13 (*(volatile unsigned char *)0xBF402013) #define CDVDreg_SCOMMAND (*(volatile unsigned char *)0xBF402016) -#define CDVDreg_SDATAIN (*(volatile unsigned char *)0xBF402017) +#define CDVDreg_SDATAIN (*(volatile unsigned char *)0xBF402017) #define CDVDreg_SDATAOUT (*(volatile unsigned char *)0xBF402018) #define CDVDreg_KEYSTATE (*(volatile unsigned char *)0xBF402038) -#define CDVDreg_KEYXOR (*(volatile unsigned char *)0xBF402039) -#define CDVDreg_DEC (*(volatile unsigned char *)0xBF40203A) +#define CDVDreg_KEYXOR (*(volatile unsigned char *)0xBF402039) +#define CDVDreg_DEC (*(volatile unsigned char *)0xBF40203A) // user cb CDVD events -#define SCECdFuncRead 1 +#define SCECdFuncRead 1 #define SCECdFuncReadCDDA 2 -#define SCECdFuncGetToc 3 -#define SCECdFuncSeek 4 -#define SCECdFuncStandby 5 -#define SCECdFuncStop 6 -#define SCECdFuncPause 7 -#define SCECdFuncBreak 8 +#define SCECdFuncGetToc 3 +#define SCECdFuncSeek 4 +#define SCECdFuncStandby 5 +#define SCECdFuncStop 6 +#define SCECdFuncPause 7 +#define SCECdFuncBreak 8 // Modes for cdInit() -#define CDVD_INIT_INIT 0x00 // init cd system and wait till commands can be issued +#define CDVD_INIT_INIT 0x00 // init cd system and wait till commands can be issued #define CDVD_INIT_NOCHECK 0x01 // init cd system -#define CDVD_INIT_EXIT 0x05 // de-init system +#define CDVD_INIT_EXIT 0x05 // de-init system // CDVD stats -#define CDVD_STAT_STOP 0x00 // disc has stopped spinning -#define CDVD_STAT_OPEN 0x01 // tray is open -#define CDVD_STAT_SPIN 0x02 // disc is spinning -#define CDVD_STAT_READ 0x06 // reading from disc +#define CDVD_STAT_STOP 0x00 // disc has stopped spinning +#define CDVD_STAT_OPEN 0x01 // tray is open +#define CDVD_STAT_SPIN 0x02 // disc is spinning +#define CDVD_STAT_READ 0x06 // reading from disc #define CDVD_STAT_PAUSE 0x0A // disc is paused -#define CDVD_STAT_SEEK 0x12 // disc is seeking +#define CDVD_STAT_SEEK 0x12 // disc is seeking #define CDVD_STAT_ERROR 0x20 // error occurred // cdTrayReq() values -#define CDVD_TRAY_OPEN 0 // Tray Open +#define CDVD_TRAY_OPEN 0 // Tray Open #define CDVD_TRAY_CLOSE 1 // Tray Close #define CDVD_TRAY_CHECK 2 // Tray Check // sceCdDiskReady() values -#define CDVD_READY_READY 0x02 +#define CDVD_READY_READY 0x02 #define CDVD_READY_NOTREADY 0x06 #define CdSpinMax 0 @@ -63,21 +63,21 @@ #define CdSpinStm 0 // cdGetError() return values -#define CDVD_ERR_FAIL -1 // error in cdGetError() -#define CDVD_ERR_NO 0x00 // no error occurred -#define CDVD_ERR_ABRT 0x01 // command was aborted due to cdBreak() call -#define CDVD_ERR_CMD 0x10 // unsupported command -#define CDVD_ERR_OPENS 0x11 // tray is open -#define CDVD_ERR_NODISC 0x12 // no disk inserted -#define CDVD_ERR_NORDY 0x13 // drive is busy processing another command -#define CDVD_ERR_CUD 0x14 // command unsupported for disc currently in drive -#define CDVD_ERR_IPI 0x20 // sector address error -#define CDVD_ERR_ILI 0x21 // num sectors error -#define CDVD_ERR_PRM 0x22 // command parameter error -#define CDVD_ERR_READ 0x30 // error while reading -#define CDVD_ERR_TRMOPN 0x31 // tray was opened -#define CDVD_ERR_EOM 0x32 // outermost error -#define CDVD_ERR_READCF 0xFD // error setting command +#define CDVD_ERR_FAIL -1 // error in cdGetError() +#define CDVD_ERR_NO 0x00 // no error occurred +#define CDVD_ERR_ABRT 0x01 // command was aborted due to cdBreak() call +#define CDVD_ERR_CMD 0x10 // unsupported command +#define CDVD_ERR_OPENS 0x11 // tray is open +#define CDVD_ERR_NODISC 0x12 // no disk inserted +#define CDVD_ERR_NORDY 0x13 // drive is busy processing another command +#define CDVD_ERR_CUD 0x14 // command unsupported for disc currently in drive +#define CDVD_ERR_IPI 0x20 // sector address error +#define CDVD_ERR_ILI 0x21 // num sectors error +#define CDVD_ERR_PRM 0x22 // command parameter error +#define CDVD_ERR_READ 0x30 // error while reading +#define CDVD_ERR_TRMOPN 0x31 // tray was opened +#define CDVD_ERR_EOM 0x32 // outermost error +#define CDVD_ERR_READCF 0xFD // error setting command #define CDVD_ERR_READCFR 0xFE // error setting command typedef struct @@ -164,15 +164,15 @@ enum CDIOC_CODE { //Codes for use with sceCdSC() #define CDSC_GET_DEBUG_STATUS 0xFFFFFFF0 //Get debug status flag. -#define CDSC_GET_INTRFLAG 0xFFFFFFF5 //Get interrupt flag. -#define CDSC_IO_SEMA 0xFFFFFFF6 //Wait (param != 0) or signal (param == 0) high-level I/O semaphore. -#define CDSC_GET_VERSION 0xFFFFFFF7 //Get CDVDMAN version. -#define CDSC_SET_ERROR 0xFFFFFFFE //Used by CDVDFSV and CDVDSTM to set the error code (Typically READCF*). -#define CDSC_OPL_SHUTDOWN 0x00000001 //Shutdown OPL +#define CDSC_GET_INTRFLAG 0xFFFFFFF5 //Get interrupt flag. +#define CDSC_IO_SEMA 0xFFFFFFF6 //Wait (param != 0) or signal (param == 0) high-level I/O semaphore. +#define CDSC_GET_VERSION 0xFFFFFFF7 //Get CDVDMAN version. +#define CDSC_SET_ERROR 0xFFFFFFFE //Used by CDVDFSV and CDVDSTM to set the error code (Typically READCF*). +#define CDSC_OPL_SHUTDOWN 0x00000001 //Shutdown OPL // exported functions prototypes #define cdvdman_IMPORTS_start DECLARE_IMPORT_TABLE(cdvdman, 1, 1) -#define cdvdman_IMPORTS_end END_IMPORT_TABLE +#define cdvdman_IMPORTS_end END_IMPORT_TABLE int sceCdInit(int init_mode); // #4 #define I_sceCdInit DECLARE_IMPORT(4, sceCdInit) diff --git a/modules/iopcore/common/oplsmb.h b/modules/iopcore/common/oplsmb.h index a800bd646..a6190235f 100644 --- a/modules/iopcore/common/oplsmb.h +++ b/modules/iopcore/common/oplsmb.h @@ -18,7 +18,7 @@ typedef struct typedef void (*OplSmbPwHashFunc_t)(server_specs_t *ss); #define oplsmb_IMPORTS_start DECLARE_IMPORT_TABLE(oplsmb, 1, 1) -#define oplsmb_IMPORTS_end END_IMPORT_TABLE +#define oplsmb_IMPORTS_end END_IMPORT_TABLE void smb_NegotiateProt(OplSmbPwHashFunc_t hash_callback); #define I_smb_NegotiateProt DECLARE_IMPORT(4, smb_NegotiateProt) diff --git a/modules/iopcore/patches/apemodpatch/main.c b/modules/iopcore/patches/apemodpatch/main.c index 02fa77428..ddadec41a 100644 --- a/modules/iopcore/patches/apemodpatch/main.c +++ b/modules/iopcore/patches/apemodpatch/main.c @@ -19,7 +19,7 @@ static int lockSema; static int evFlag; #define EV_ACTIVITY 1 -#define EV_TIMEOUT 2 +#define EV_TIMEOUT 2 static int _lock(void) { //Do polling, to keep the original behaviour. diff --git a/modules/iopcore/udnl-t300/include/COFF.h b/modules/iopcore/udnl-t300/include/COFF.h index c10432ac0..2a00e2a42 100644 --- a/modules/iopcore/udnl-t300/include/COFF.h +++ b/modules/iopcore/udnl-t300/include/COFF.h @@ -15,7 +15,7 @@ struct coff_filehdr #define MIPSELMAGIC 0x0162 -#define OMAGIC 0407 +#define OMAGIC 0407 #define SOMAGIC 0x0701 typedef struct aouthdr diff --git a/modules/iopcore/udnl-t300/include/ELF.h b/modules/iopcore/udnl-t300/include/ELF.h index 00b85f6b0..7756b3cdd 100644 --- a/modules/iopcore/udnl-t300/include/ELF.h +++ b/modules/iopcore/udnl-t300/include/ELF.h @@ -1,7 +1,7 @@ /* ELF-loading stuff */ -#define ELF_MAGIC 0x464c457f +#define ELF_MAGIC 0x464c457f #define ELF_TYPE_SCE_IRX 0xFF80 /* SCE IOP Relocatable eXcutable file */ -#define ELF_PT_LOAD 1 +#define ELF_PT_LOAD 1 /*------------------------------*/ typedef struct @@ -86,17 +86,17 @@ enum ELF_reloc_types { R_MIPS_LO16 }; -#define SHT_LOPROC 0x70000000 +#define SHT_LOPROC 0x70000000 #define SHT_LOPROC_EE_IMPORT_TAB 0x90 -#define SHT_LOPROC_IOPMOD 0x80 -#define SHT_HIPROC 0x7fffffff -#define SHT_LOUSER 0x80000000 -#define SHT_HIUSER 0xffffffff +#define SHT_LOPROC_IOPMOD 0x80 +#define SHT_HIPROC 0x7fffffff +#define SHT_LOUSER 0x80000000 +#define SHT_HIUSER 0xffffffff -#define SHF_WRITE 0x1 -#define SHF_ALLOC 0x2 +#define SHF_WRITE 0x1 +#define SHF_ALLOC 0x2 #define SHF_EXECINSTR 0x4 -#define SHF_MASKPROC 0xf0000000 +#define SHF_MASKPROC 0xf0000000 struct iopmod_id { diff --git a/modules/iopcore/udnl-t300/udnl.c b/modules/iopcore/udnl-t300/udnl.c index c04d9de5c..f2482aab2 100644 --- a/modules/iopcore/udnl-t300/udnl.c +++ b/modules/iopcore/udnl-t300/udnl.c @@ -19,7 +19,7 @@ int CpuExecuteKmode(void *function, ...); //Exactly the same function as INTRMAN #define DEBUG_PRINTF(args...) #endif -#define FULL_UDNL 1 //Comment out to build a UDNL module that updates the IOP with only its payload. +#define FULL_UDNL 1 //Comment out to build a UDNL module that updates the IOP with only its payload. #define MAX_MODULES 256 #define alloca(size) __builtin_alloca(size) //The homebrew PS2SDK lacks alloca.h. diff --git a/modules/iopcore/udnl/include/COFF.h b/modules/iopcore/udnl/include/COFF.h index c10432ac0..2a00e2a42 100644 --- a/modules/iopcore/udnl/include/COFF.h +++ b/modules/iopcore/udnl/include/COFF.h @@ -15,7 +15,7 @@ struct coff_filehdr #define MIPSELMAGIC 0x0162 -#define OMAGIC 0407 +#define OMAGIC 0407 #define SOMAGIC 0x0701 typedef struct aouthdr diff --git a/modules/iopcore/udnl/include/ELF.h b/modules/iopcore/udnl/include/ELF.h index 00b85f6b0..7756b3cdd 100644 --- a/modules/iopcore/udnl/include/ELF.h +++ b/modules/iopcore/udnl/include/ELF.h @@ -1,7 +1,7 @@ /* ELF-loading stuff */ -#define ELF_MAGIC 0x464c457f +#define ELF_MAGIC 0x464c457f #define ELF_TYPE_SCE_IRX 0xFF80 /* SCE IOP Relocatable eXcutable file */ -#define ELF_PT_LOAD 1 +#define ELF_PT_LOAD 1 /*------------------------------*/ typedef struct @@ -86,17 +86,17 @@ enum ELF_reloc_types { R_MIPS_LO16 }; -#define SHT_LOPROC 0x70000000 +#define SHT_LOPROC 0x70000000 #define SHT_LOPROC_EE_IMPORT_TAB 0x90 -#define SHT_LOPROC_IOPMOD 0x80 -#define SHT_HIPROC 0x7fffffff -#define SHT_LOUSER 0x80000000 -#define SHT_HIUSER 0xffffffff +#define SHT_LOPROC_IOPMOD 0x80 +#define SHT_HIPROC 0x7fffffff +#define SHT_LOUSER 0x80000000 +#define SHT_HIUSER 0xffffffff -#define SHF_WRITE 0x1 -#define SHF_ALLOC 0x2 +#define SHF_WRITE 0x1 +#define SHF_ALLOC 0x2 #define SHF_EXECINSTR 0x4 -#define SHF_MASKPROC 0xf0000000 +#define SHF_MASKPROC 0xf0000000 struct iopmod_id { diff --git a/modules/iopcore/udnl/udnl.c b/modules/iopcore/udnl/udnl.c index 622a2e1e6..23cc87d45 100644 --- a/modules/iopcore/udnl/udnl.c +++ b/modules/iopcore/udnl/udnl.c @@ -17,7 +17,7 @@ #define DEBUG_PRINTF(args...) #endif -#define FULL_UDNL 1 //Comment out to build a UDNL module that updates the IOP with only its payload. +#define FULL_UDNL 1 //Comment out to build a UDNL module that updates the IOP with only its payload. #define MAX_MODULES 256 #define alloca(size) __builtin_alloca(size) //The homebrew PS2SDK lacks alloca.h. diff --git a/modules/isofs/imports.lst b/modules/isofs/imports.lst index 7a008ed35..e30533f0c 100644 --- a/modules/isofs/imports.lst +++ b/modules/isofs/imports.lst @@ -24,4 +24,3 @@ I_strncpy I_strchr I_strrchr sysclib_IMPORTS_end - diff --git a/modules/mcemu/mcemu.c b/modules/mcemu/mcemu.c index f91246080..48e17ae84 100644 --- a/modules/mcemu/mcemu.c +++ b/modules/mcemu/mcemu.c @@ -360,7 +360,7 @@ int hookSecrAuthCard(int port, int slot, int cnum) #define SIO2CTRL (*(volatile u32 *)(0xbf808268)) #define SIO2STAT (*(volatile u32 *)(0xbf80826c)) -#define SIO2CMD ((volatile u32 *)(0xbf808200)) +#define SIO2CMD ((volatile u32 *)(0xbf808200)) static Sio2Packet *temp_packet = NULL; static int skip_sema_wait = 0; diff --git a/modules/mcemu/mcemu_utils.h b/modules/mcemu/mcemu_utils.h index f38737a50..306d78a91 100644 --- a/modules/mcemu/mcemu_utils.h +++ b/modules/mcemu/mcemu_utils.h @@ -53,7 +53,7 @@ void bdm_writeSector(unsigned int lba, unsigned short int nsectors, const unsign #ifdef HDD_DRIVER /* These are used with the dir parameter of ata_device_dma_transfer(). */ -#define ATA_DIR_READ 0 +#define ATA_DIR_READ 0 #define ATA_DIR_WRITE 1 int ata_device_sector_io(unsigned int unit, void *buf, unsigned int lba, unsigned int sectors, int dir); diff --git a/modules/network/SMSTCPIP/api_msg.c b/modules/network/SMSTCPIP/api_msg.c index ac0d6366a..9c684a785 100644 --- a/modules/network/SMSTCPIP/api_msg.c +++ b/modules/network/SMSTCPIP/api_msg.c @@ -734,7 +734,7 @@ do_write(struct api_msg_msg *msg) segments when new outgoing data arrives from the user if any previously transmitted data on the connection remains unacknowledged. */ - if (err == ERR_OK && (msg->conn->pcb.tcp->unacked == NULL || (msg->conn->pcb.tcp->flags & TF_NODELAY) || ( msg->conn->pcb.tcp->snd_queuelen) > 1)) { + if (err == ERR_OK && (msg->conn->pcb.tcp->unacked == NULL || (msg->conn->pcb.tcp->flags & TF_NODELAY) || (msg->conn->pcb.tcp->snd_queuelen) > 1)) { tcp_output(msg->conn->pcb.tcp); } msg->conn->err = err; diff --git a/modules/network/SMSTCPIP/etharp.c b/modules/network/SMSTCPIP/etharp.c index 51178bfce..2b6b24266 100644 --- a/modules/network/SMSTCPIP/etharp.c +++ b/modules/network/SMSTCPIP/etharp.c @@ -93,7 +93,7 @@ RFC 3220 4.6 IP Mobility Support for IPv4 January 2002 #endif /** the time an ARP entry stays valid after its last update, (120 * 10) seconds = 20 minutes. */ -#define ARP_MAXAGE 120 +#define ARP_MAXAGE 120 /** the time an ARP entry stays pending after first request, (2 * 10) seconds = 20 seconds. */ #define ARP_MAXPENDING 2 @@ -101,12 +101,12 @@ RFC 3220 4.6 IP Mobility Support for IPv4 January 2002 /** ARP message types */ #define ARP_REQUEST 0x0100 -#define ARP_REPLY 0x0200 +#define ARP_REPLY 0x0200 -#define ARPH_HWLEN(hdr) (ntohs((hdr)->_hwlen_protolen) >> 8) +#define ARPH_HWLEN(hdr) (ntohs((hdr)->_hwlen_protolen) >> 8) #define ARPH_PROTOLEN(hdr) (ntohs((hdr)->_hwlen_protolen) & 0xff) -#define ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = htons(ARPH_PROTOLEN(hdr) | ((len) << 8)) +#define ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = htons(ARPH_PROTOLEN(hdr) | ((len) << 8)) #define ARPH_PROTOLEN_SET(hdr, len) (hdr)->_hwlen_protolen = htons((len) | (ARPH_HWLEN(hdr) << 8)) enum etharp_state { diff --git a/modules/network/SMSTCPIP/include/arch/cc.h b/modules/network/SMSTCPIP/include/arch/cc.h index d18fe6ada..e55f20977 100644 --- a/modules/network/SMSTCPIP/include/arch/cc.h +++ b/modules/network/SMSTCPIP/include/arch/cc.h @@ -13,5 +13,5 @@ typedef signed long s32_t; typedef u32_t mem_ptr_t; #define PACK_STRUCT_FIELD(x) x __attribute__((packed)) -#define PACK_STRUCT_STRUCT __attribute__((packed)) +#define PACK_STRUCT_STRUCT __attribute__((packed)) #endif /* __CC_H__ */ diff --git a/modules/network/SMSTCPIP/include/arch/sys_arch.h b/modules/network/SMSTCPIP/include/arch/sys_arch.h index 4ec30b634..4e1c83b72 100644 --- a/modules/network/SMSTCPIP/include/arch/sys_arch.h +++ b/modules/network/SMSTCPIP/include/arch/sys_arch.h @@ -7,15 +7,15 @@ typedef struct sys_mbox *sys_mbox_t; typedef int sys_thread_t; #define SYS_MBOX_NULL NULL -#define SYS_SEM_NULL 0 +#define SYS_SEM_NULL 0 #if MEM_LIBC_MALLOC void *ps2ip_mem_malloc(int size); void ps2ip_mem_free(void *rmem); void *ps2ip_mem_realloc(void *rmem, int newsize); -#define mem_clib_free ps2ip_mem_free -#define mem_clib_malloc ps2ip_mem_malloc +#define mem_clib_free ps2ip_mem_free +#define mem_clib_malloc ps2ip_mem_malloc #define mem_clib_realloc ps2ip_mem_realloc #endif diff --git a/modules/network/SMSTCPIP/include/lwip/api.h b/modules/network/SMSTCPIP/include/lwip/api.h index 32f654dd0..76416a6a0 100644 --- a/modules/network/SMSTCPIP/include/lwip/api.h +++ b/modules/network/SMSTCPIP/include/lwip/api.h @@ -45,7 +45,7 @@ #include "lwip/err.h" #define NETCONN_NOCOPY 0x00 -#define NETCONN_COPY 0x01 +#define NETCONN_COPY 0x01 enum netconn_type { NETCONN_TCP, @@ -104,7 +104,7 @@ void netbuf_delete(struct netbuf *buf); void *netbuf_alloc(struct netbuf *buf, u16_t size); void netbuf_free(struct netbuf *buf); err_t netbuf_ref(struct netbuf *buf, - void *dataptr, u16_t size); + void *dataptr, u16_t size); void netbuf_chain(struct netbuf *head, struct netbuf *tail); @@ -115,13 +115,13 @@ void netbuf_first(struct netbuf *buf); void netbuf_copy_partial(struct netbuf *buf, void *dataptr, u16_t len, u16_t offset); -#define netbuf_fromaddr(b) (b->fromaddr) -#define netbuf_fromport(b) (b->fromport) -#define netbuf_len(b) (b->p->tot_len) -#define netbuf_first(b) (b->ptr = b->p) -#define netconn_new(t) netconn_new_with_proto_and_callback((t), 0, NULL) +#define netbuf_fromaddr(b) (b->fromaddr) +#define netbuf_fromport(b) (b->fromport) +#define netbuf_len(b) (b->p->tot_len) +#define netbuf_first(b) (b->ptr = b->p) +#define netconn_new(t) netconn_new_with_proto_and_callback((t), 0, NULL) #define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback((t), 0, (c)) -#define netconn_type(c) (c->type) +#define netconn_type(c) (c->type) /* Network connection functions: */ struct diff --git a/modules/network/SMSTCPIP/include/lwip/api_msg.h b/modules/network/SMSTCPIP/include/lwip/api_msg.h index 97ba2874b..6d2d8f82b 100644 --- a/modules/network/SMSTCPIP/include/lwip/api_msg.h +++ b/modules/network/SMSTCPIP/include/lwip/api_msg.h @@ -96,6 +96,6 @@ typedef void (*api_msg_decode)(struct api_msg_msg *); extern api_msg_decode __decode__[API_MSG_MAX]; #define api_msg_input(m) __decode__[m->type](&(m->msg)) -#define api_msg_post(m) tcpip_apimsg(m) +#define api_msg_post(m) tcpip_apimsg(m) #endif /* __LWIP_API_MSG_H__ */ diff --git a/modules/network/SMSTCPIP/include/lwip/arch.h b/modules/network/SMSTCPIP/include/lwip/arch.h index 1f7f54f48..7dcb67832 100644 --- a/modules/network/SMSTCPIP/include/lwip/arch.h +++ b/modules/network/SMSTCPIP/include/lwip/arch.h @@ -58,154 +58,154 @@ #ifdef LWIP_PROVIDE_ERRNO -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ +#define EPERM 1 /* Operation not permitted */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* I/O error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file number */ +#define ECHILD 10 /* No child processes */ +#define EAGAIN 11 /* Try again */ +#define ENOMEM 12 /* Out of memory */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Block device required */ +#define EBUSY 16 /* Device or resource busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* File table overflow */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Not a typewriter */ +#define ETXTBSY 26 /* Text file busy */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Math argument out of domain of func */ +#define ERANGE 34 /* Math result not representable */ +#define EDEADLK 35 /* Resource deadlock would occur */ +#define ENAMETOOLONG 36 /* File name too long */ +#define ENOLCK 37 /* No record locks available */ +#define ENOSYS 38 /* Function not implemented */ +#define ENOTEMPTY 39 /* Directory not empty */ +#define ELOOP 40 /* Too many symbolic links encountered */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ +#define ENOMSG 42 /* No message of desired type */ +#define EIDRM 43 /* Identifier removed */ +#define ECHRNG 44 /* Channel number out of range */ +#define EL2NSYNC 45 /* Level 2 not synchronized */ +#define EL3HLT 46 /* Level 3 halted */ +#define EL3RST 47 /* Level 3 reset */ +#define ELNRNG 48 /* Link number out of range */ +#define EUNATCH 49 /* Protocol driver not attached */ +#define ENOCSI 50 /* No CSI structure available */ +#define EL2HLT 51 /* Level 2 halted */ +#define EBADE 52 /* Invalid exchange */ +#define EBADR 53 /* Invalid request descriptor */ +#define EXFULL 54 /* Exchange full */ +#define ENOANO 55 /* No anode */ +#define EBADRQC 56 /* Invalid request code */ +#define EBADSLT 57 /* Invalid slot */ #define EDEADLOCK EDEADLK -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale NFS file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ +#define EBFONT 59 /* Bad font file format */ +#define ENOSTR 60 /* Device not a stream */ +#define ENODATA 61 /* No data available */ +#define ETIME 62 /* Timer expired */ +#define ENOSR 63 /* Out of streams resources */ +#define ENONET 64 /* Machine is not on the network */ +#define ENOPKG 65 /* Package not installed */ +#define EREMOTE 66 /* Object is remote */ +#define ENOLINK 67 /* Link has been severed */ +#define EADV 68 /* Advertise error */ +#define ESRMNT 69 /* Srmount error */ +#define ECOMM 70 /* Communication error on send */ +#define EPROTO 71 /* Protocol error */ +#define EMULTIHOP 72 /* Multihop attempted */ +#define EDOTDOT 73 /* RFS specific error */ +#define EBADMSG 74 /* Not a data message */ +#define EOVERFLOW 75 /* Value too large for defined data type */ +#define ENOTUNIQ 76 /* Name not unique on network */ +#define EBADFD 77 /* File descriptor in bad state */ +#define EREMCHG 78 /* Remote address changed */ +#define ELIBACC 79 /* Can not access a needed shared library */ +#define ELIBBAD 80 /* Accessing a corrupted shared library */ +#define ELIBSCN 81 /* .lib section in a.out corrupted */ +#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ +#define ELIBEXEC 83 /* Cannot exec a shared library directly */ +#define EILSEQ 84 /* Illegal byte sequence */ +#define ERESTART 85 /* Interrupted system call should be restarted */ +#define ESTRPIPE 86 /* Streams pipe error */ +#define EUSERS 87 /* Too many users */ +#define ENOTSOCK 88 /* Socket operation on non-socket */ +#define EDESTADDRREQ 89 /* Destination address required */ +#define EMSGSIZE 90 /* Message too long */ +#define EPROTOTYPE 91 /* Protocol wrong type for socket */ +#define ENOPROTOOPT 92 /* Protocol not available */ +#define EPROTONOSUPPORT 93 /* Protocol not supported */ +#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ +#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EPFNOSUPPORT 96 /* Protocol family not supported */ +#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ +#define EADDRINUSE 98 /* Address already in use */ +#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ +#define ENETDOWN 100 /* Network is down */ +#define ENETUNREACH 101 /* Network is unreachable */ +#define ENETRESET 102 /* Network dropped connection because of reset */ +#define ECONNABORTED 103 /* Software caused connection abort */ +#define ECONNRESET 104 /* Connection reset by peer */ +#define ENOBUFS 105 /* No buffer space available */ +#define EISCONN 106 /* Transport endpoint is already connected */ +#define ENOTCONN 107 /* Transport endpoint is not connected */ +#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ +#define ETOOMANYREFS 109 /* Too many references: cannot splice */ +#define ETIMEDOUT 110 /* Connection timed out */ +#define ECONNREFUSED 111 /* Connection refused */ +#define EHOSTDOWN 112 /* Host is down */ +#define EHOSTUNREACH 113 /* No route to host */ +#define EALREADY 114 /* Operation already in progress */ +#define EINPROGRESS 115 /* Operation now in progress */ +#define ESTALE 116 /* Stale NFS file handle */ +#define EUCLEAN 117 /* Structure needs cleaning */ +#define ENOTNAM 118 /* Not a XENIX named type file */ +#define ENAVAIL 119 /* No XENIX semaphores available */ +#define EISNAM 120 /* Is a named type file */ +#define EREMOTEIO 121 /* Remote I/O error */ +#define EDQUOT 122 /* Quota exceeded */ + +#define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ -#define ENSROK 0 /* DNS server returned answer with no data */ -#define ENSRNODATA 160 /* DNS server returned answer with no data */ -#define ENSRFORMERR 161 /* DNS server claims query was misformatted */ -#define ENSRSERVFAIL 162 /* DNS server returned general failure */ -#define ENSRNOTFOUND 163 /* Domain name not found */ -#define ENSRNOTIMP 164 /* DNS server does not implement requested operation */ -#define ENSRREFUSED 165 /* DNS server refused query */ -#define ENSRBADQUERY 166 /* Misformatted DNS query */ -#define ENSRBADNAME 167 /* Misformatted domain name */ -#define ENSRBADFAMILY 168 /* Unsupported address family */ -#define ENSRBADRESP 169 /* Misformatted DNS reply */ -#define ENSRCONNREFUSED 170 /* Could not contact DNS servers */ -#define ENSRTIMEOUT 171 /* Timeout while contacting DNS servers */ -#define ENSROF 172 /* End of file */ -#define ENSRFILE 173 /* Error reading file */ -#define ENSRNOMEM 174 /* Out of memory */ -#define ENSRDESTRUCTION 175 /* Application terminated lookup */ +#define ENSROK 0 /* DNS server returned answer with no data */ +#define ENSRNODATA 160 /* DNS server returned answer with no data */ +#define ENSRFORMERR 161 /* DNS server claims query was misformatted */ +#define ENSRSERVFAIL 162 /* DNS server returned general failure */ +#define ENSRNOTFOUND 163 /* Domain name not found */ +#define ENSRNOTIMP 164 /* DNS server does not implement requested operation */ +#define ENSRREFUSED 165 /* DNS server refused query */ +#define ENSRBADQUERY 166 /* Misformatted DNS query */ +#define ENSRBADNAME 167 /* Misformatted domain name */ +#define ENSRBADFAMILY 168 /* Unsupported address family */ +#define ENSRBADRESP 169 /* Misformatted DNS reply */ +#define ENSRCONNREFUSED 170 /* Could not contact DNS servers */ +#define ENSRTIMEOUT 171 /* Timeout while contacting DNS servers */ +#define ENSROF 172 /* End of file */ +#define ENSRFILE 173 /* Error reading file */ +#define ENSRNOMEM 174 /* Out of memory */ +#define ENSRDESTRUCTION 175 /* Application terminated lookup */ #define ENSRQUERYDOMAINTOOLONG 176 /* Domain name is too long */ -#define ENSRCNAMELOOP 177 /* Domain name is too long */ +#define ENSRCNAMELOOP 177 /* Domain name is too long */ #ifndef errno extern int errno; diff --git a/modules/network/SMSTCPIP/include/lwip/debug.h b/modules/network/SMSTCPIP/include/lwip/debug.h index 1eae472bd..8495f45f9 100644 --- a/modules/network/SMSTCPIP/include/lwip/debug.h +++ b/modules/network/SMSTCPIP/include/lwip/debug.h @@ -41,14 +41,14 @@ * - 3 severe */ -#define DBG_LEVEL_OFF 0 +#define DBG_LEVEL_OFF 0 #define DBG_LEVEL_WARNING 1 /* bad checksums, dropped packets, ... */ #define DBG_LEVEL_SERIOUS 2 /* memory allocation failures, ... */ -#define DBG_LEVEL_SEVERE 3 /* */ -#define DBG_MASK_LEVEL 3 +#define DBG_LEVEL_SEVERE 3 /* */ +#define DBG_MASK_LEVEL 3 /** flag for LWIP_DEBUGF to enable that debug message */ -#define DBG_ON 0x80U +#define DBG_ON 0x80U /** flag for LWIP_DEBUGF to disable that debug message */ #define DBG_OFF 0x00U @@ -59,7 +59,7 @@ /** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ #define DBG_FRESH 0x10U /** flag for LWIP_DEBUGF to halt after printing this debug message */ -#define DBG_HALT 0x08U +#define DBG_HALT 0x08U #ifndef LWIP_NOASSERT #define LWIP_ASSERT(x, y) \ diff --git a/modules/network/SMSTCPIP/include/lwip/dhcp.h b/modules/network/SMSTCPIP/include/lwip/dhcp.h index 80f2d8c52..8f64a89e7 100644 --- a/modules/network/SMSTCPIP/include/lwip/dhcp.h +++ b/modules/network/SMSTCPIP/include/lwip/dhcp.h @@ -11,7 +11,7 @@ /** period (in seconds) of the application calling dhcp_coarse_tmr() */ #define DHCP_COARSE_TIMER_SECS 60 /** period (in milliseconds) of the application calling dhcp_fine_tmr() */ -#define DHCP_FINE_TIMER_MSECS 500 +#define DHCP_FINE_TIMER_MSECS 500 struct dhcp { @@ -114,55 +114,55 @@ void dhcp_coarse_tmr(void); void dhcp_fine_tmr(void); /** DHCP message item offsets and length */ -#define DHCP_MSG_OFS (UDP_DATA_OFS) -#define DHCP_OP_OFS (DHCP_MSG_OFS + 0) -#define DHCP_HTYPE_OFS (DHCP_MSG_OFS + 1) -#define DHCP_HLEN_OFS (DHCP_MSG_OFS + 2) -#define DHCP_HOPS_OFS (DHCP_MSG_OFS + 3) -#define DHCP_XID_OFS (DHCP_MSG_OFS + 4) -#define DHCP_SECS_OFS (DHCP_MSG_OFS + 8) -#define DHCP_FLAGS_OFS (DHCP_MSG_OFS + 10) +#define DHCP_MSG_OFS (UDP_DATA_OFS) +#define DHCP_OP_OFS (DHCP_MSG_OFS + 0) +#define DHCP_HTYPE_OFS (DHCP_MSG_OFS + 1) +#define DHCP_HLEN_OFS (DHCP_MSG_OFS + 2) +#define DHCP_HOPS_OFS (DHCP_MSG_OFS + 3) +#define DHCP_XID_OFS (DHCP_MSG_OFS + 4) +#define DHCP_SECS_OFS (DHCP_MSG_OFS + 8) +#define DHCP_FLAGS_OFS (DHCP_MSG_OFS + 10) #define DHCP_CIADDR_OFS (DHCP_MSG_OFS + 12) #define DHCP_YIADDR_OFS (DHCP_MSG_OFS + 16) #define DHCP_SIADDR_OFS (DHCP_MSG_OFS + 20) #define DHCP_GIADDR_OFS (DHCP_MSG_OFS + 24) #define DHCP_CHADDR_OFS (DHCP_MSG_OFS + 28) -#define DHCP_SNAME_OFS (DHCP_MSG_OFS + 44) -#define DHCP_FILE_OFS (DHCP_MSG_OFS + 108) -#define DHCP_MSG_LEN 236 +#define DHCP_SNAME_OFS (DHCP_MSG_OFS + 44) +#define DHCP_FILE_OFS (DHCP_MSG_OFS + 108) +#define DHCP_MSG_LEN 236 -#define DHCP_COOKIE_OFS (DHCP_MSG_OFS + DHCP_MSG_LEN) +#define DHCP_COOKIE_OFS (DHCP_MSG_OFS + DHCP_MSG_LEN) #define DHCP_OPTIONS_OFS (DHCP_MSG_OFS + DHCP_MSG_LEN + 4) #define DHCP_CLIENT_PORT 68 #define DHCP_SERVER_PORT 67 /** DHCP client states */ -#define DHCP_REQUESTING 1 -#define DHCP_INIT 2 -#define DHCP_REBOOTING 3 -#define DHCP_REBINDING 4 -#define DHCP_RENEWING 5 -#define DHCP_SELECTING 6 -#define DHCP_INFORMING 7 -#define DHCP_CHECKING 8 -#define DHCP_PERMANENT 9 -#define DHCP_BOUND 10 +#define DHCP_REQUESTING 1 +#define DHCP_INIT 2 +#define DHCP_REBOOTING 3 +#define DHCP_REBINDING 4 +#define DHCP_RENEWING 5 +#define DHCP_SELECTING 6 +#define DHCP_INFORMING 7 +#define DHCP_CHECKING 8 +#define DHCP_PERMANENT 9 +#define DHCP_BOUND 10 /** not yet implemented #define DHCP_RELEASING 11 */ #define DHCP_BACKING_OFF 12 -#define DHCP_OFF 13 +#define DHCP_OFF 13 #define DHCP_BOOTREQUEST 1 -#define DHCP_BOOTREPLY 2 +#define DHCP_BOOTREPLY 2 #define DHCP_DISCOVER 1 -#define DHCP_OFFER 2 -#define DHCP_REQUEST 3 -#define DHCP_DECLINE 4 -#define DHCP_ACK 5 -#define DHCP_NAK 6 -#define DHCP_RELEASE 7 -#define DHCP_INFORM 8 +#define DHCP_OFFER 2 +#define DHCP_REQUEST 3 +#define DHCP_DECLINE 4 +#define DHCP_ACK 5 +#define DHCP_NAK 6 +#define DHCP_RELEASE 7 +#define DHCP_INFORM 8 #define DHCP_HTYPE_ETH 1 @@ -172,41 +172,41 @@ void dhcp_fine_tmr(void); #define DHCP_BROADCAST_MASK (1 << DHCP_FLAG_BROADCAST) /** BootP options */ -#define DHCP_OPTION_PAD 0 +#define DHCP_OPTION_PAD 0 #define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ -#define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_HOSTNAME 12 -#define DHCP_OPTION_IP_TTL 23 -#define DHCP_OPTION_MTU 26 -#define DHCP_OPTION_BROADCAST 28 -#define DHCP_OPTION_TCP_TTL 37 -#define DHCP_OPTION_END 255 +#define DHCP_OPTION_ROUTER 3 +#define DHCP_OPTION_HOSTNAME 12 +#define DHCP_OPTION_IP_TTL 23 +#define DHCP_OPTION_MTU 26 +#define DHCP_OPTION_BROADCAST 28 +#define DHCP_OPTION_TCP_TTL 37 +#define DHCP_OPTION_END 255 /** DHCP options */ #define DHCP_OPTION_REQUESTED_IP 50 /* RFC 2132 9.1, requested IP address */ -#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */ -#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */ +#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */ +#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */ -#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */ +#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */ #define DHCP_OPTION_MESSAGE_TYPE_LEN 1 -#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */ +#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */ #define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */ -#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */ +#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */ #define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 -#define DHCP_OPTION_T1 58 /* T1 renewal time */ -#define DHCP_OPTION_T2 59 /* T2 rebinding time */ -#define DHCP_OPTION_CLIENT_ID 61 +#define DHCP_OPTION_T1 58 /* T1 renewal time */ +#define DHCP_OPTION_T2 59 /* T2 rebinding time */ +#define DHCP_OPTION_CLIENT_ID 61 #define DHCP_OPTION_TFTP_SERVERNAME 66 -#define DHCP_OPTION_BOOTFILE 67 +#define DHCP_OPTION_BOOTFILE 67 /** possible combinations of overloading the file and sname fields with options */ -#define DHCP_OVERLOAD_NONE 0 -#define DHCP_OVERLOAD_FILE 1 -#define DHCP_OVERLOAD_SNAME 2 +#define DHCP_OVERLOAD_NONE 0 +#define DHCP_OVERLOAD_FILE 1 +#define DHCP_OVERLOAD_SNAME 2 #define DHCP_OVERLOAD_SNAME_FILE 3 #endif /*__LWIP_DHCP_H__*/ diff --git a/modules/network/SMSTCPIP/include/lwip/err.h b/modules/network/SMSTCPIP/include/lwip/err.h index 4d3277060..116362de5 100644 --- a/modules/network/SMSTCPIP/include/lwip/err.h +++ b/modules/network/SMSTCPIP/include/lwip/err.h @@ -40,13 +40,13 @@ typedef s8_t err_t; /* Definitions for error constants. */ -#define ERR_OK 0 /* No error, everything OK. */ +#define ERR_OK 0 /* No error, everything OK. */ #define ERR_MEM -1 /* Out of memory error. */ #define ERR_BUF -2 /* Buffer error. */ #define ERR_ABRT -3 /* Connection aborted. */ -#define ERR_RST -4 /* Connection reset. */ +#define ERR_RST -4 /* Connection reset. */ #define ERR_CLSD -5 /* Connection closed. */ #define ERR_CONN -6 /* Not connected. */ diff --git a/modules/network/SMSTCPIP/include/lwip/icmp.h b/modules/network/SMSTCPIP/include/lwip/icmp.h index 37506cfc5..e3e39706d 100644 --- a/modules/network/SMSTCPIP/include/lwip/icmp.h +++ b/modules/network/SMSTCPIP/include/lwip/icmp.h @@ -39,17 +39,17 @@ #include "lwip/netif.h" -#define ICMP_ER 0 /* echo reply */ -#define ICMP_DUR 3 /* destination unreachable */ -#define ICMP_SQ 4 /* source quench */ -#define ICMP_RD 5 /* redirect */ -#define ICMP_ECHO 8 /* echo */ -#define ICMP_TE 11 /* time exceeded */ -#define ICMP_PP 12 /* parameter problem */ -#define ICMP_TS 13 /* timestamp */ -#define ICMP_TSR 14 /* timestamp reply */ -#define ICMP_IRQ 15 /* information request */ -#define ICMP_IR 16 /* information reply */ +#define ICMP_ER 0 /* echo reply */ +#define ICMP_DUR 3 /* destination unreachable */ +#define ICMP_SQ 4 /* source quench */ +#define ICMP_RD 5 /* redirect */ +#define ICMP_ECHO 8 /* echo */ +#define ICMP_TE 11 /* time exceeded */ +#define ICMP_PP 12 /* parameter problem */ +#define ICMP_TS 13 /* timestamp */ +#define ICMP_TSR 14 /* timestamp reply */ +#define ICMP_IRQ 15 /* information request */ +#define ICMP_IR 16 /* information reply */ enum icmp_dur_type { ICMP_DUR_NET = 0, /* net unreachable */ diff --git a/modules/network/SMSTCPIP/include/lwip/ip.h b/modules/network/SMSTCPIP/include/lwip/ip.h index fa8ea4042..ac5e46770 100644 --- a/modules/network/SMSTCPIP/include/lwip/ip.h +++ b/modules/network/SMSTCPIP/include/lwip/ip.h @@ -54,10 +54,10 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, #define IP_HLEN 20 -#define IP_PROTO_ICMP 1 -#define IP_PROTO_UDP 17 +#define IP_PROTO_ICMP 1 +#define IP_PROTO_UDP 17 #define IP_PROTO_UDPLITE 170 -#define IP_PROTO_TCP 6 +#define IP_PROTO_TCP 6 /* This is passed as the destination address to ip_output_if (not to ip_output), meaning that an IP header already is constructed @@ -85,16 +85,16 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, /* * Option flags per-socket. These are the same like SO_XXX. */ -#define SOF_DEBUG (u16_t)0x0001U /* turn on debugging info recording */ -#define SOF_ACCEPTCONN (u16_t)0x0002U /* socket has had listen() */ -#define SOF_REUSEADDR (u16_t)0x0004U /* allow local address reuse */ -#define SOF_KEEPALIVE (u16_t)0x0008U /* keep connections alive */ -#define SOF_DONTROUTE (u16_t)0x0010U /* just use interface addresses */ -#define SOF_BROADCAST (u16_t)0x0020U /* permit sending of broadcast msgs */ +#define SOF_DEBUG (u16_t)0x0001U /* turn on debugging info recording */ +#define SOF_ACCEPTCONN (u16_t)0x0002U /* socket has had listen() */ +#define SOF_REUSEADDR (u16_t)0x0004U /* allow local address reuse */ +#define SOF_KEEPALIVE (u16_t)0x0008U /* keep connections alive */ +#define SOF_DONTROUTE (u16_t)0x0010U /* just use interface addresses */ +#define SOF_BROADCAST (u16_t)0x0020U /* permit sending of broadcast msgs */ #define SOF_USELOOPBACK (u16_t)0x0040U /* bypass hardware when possible */ -#define SOF_LINGER (u16_t)0x0080U /* linger on close if data present */ -#define SOF_OOBINLINE (u16_t)0x0100U /* leave received OOB data in line */ -#define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */ +#define SOF_LINGER (u16_t)0x0080U /* linger on close if data present */ +#define SOF_OOBINLINE (u16_t)0x0100U /* leave received OOB data in line */ +#define SOF_REUSEPORT (u16_t)0x0200U /* allow local address & port reuse */ @@ -112,9 +112,9 @@ struct ip_hdr PACK_STRUCT_FIELD(u16_t _id); /* fragment offset field */ PACK_STRUCT_FIELD(u16_t _offset); -#define IP_RF 0x8000 /* reserved fragment flag */ -#define IP_DF 0x4000 /* dont fragment flag */ -#define IP_MF 0x2000 /* more fragments flag */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ /* time to live / protocol*/ PACK_STRUCT_FIELD(u16_t _ttl_proto); @@ -129,23 +129,23 @@ PACK_STRUCT_END #include "arch/epstruct.h" #endif -#define IPH_V(hdr) (ntohs((hdr)->_v_hl_tos) >> 12) -#define IPH_HL(hdr) ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f) -#define IPH_TOS(hdr) (htons((ntohs((hdr)->_v_hl_tos) & 0xff))) -#define IPH_LEN(hdr) ((hdr)->_len) -#define IPH_ID(hdr) ((hdr)->_id) +#define IPH_V(hdr) (ntohs((hdr)->_v_hl_tos) >> 12) +#define IPH_HL(hdr) ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f) +#define IPH_TOS(hdr) (htons((ntohs((hdr)->_v_hl_tos) & 0xff))) +#define IPH_LEN(hdr) ((hdr)->_len) +#define IPH_ID(hdr) ((hdr)->_id) #define IPH_OFFSET(hdr) ((hdr)->_offset) -#define IPH_TTL(hdr) (ntohs((hdr)->_ttl_proto) >> 8) -#define IPH_PROTO(hdr) (ntohs((hdr)->_ttl_proto) & 0xff) +#define IPH_TTL(hdr) (ntohs((hdr)->_ttl_proto) >> 8) +#define IPH_PROTO(hdr) (ntohs((hdr)->_ttl_proto) & 0xff) #define IPH_CHKSUM(hdr) ((hdr)->_chksum) #define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos))) -#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) -#define IPH_ID_SET(hdr, id) (hdr)->_id = (id) -#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) -#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = (htons(IPH_PROTO(hdr) | ((ttl) << 8))) -#define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = (htons((proto) | (IPH_TTL(hdr) << 8))) -#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) +#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) +#define IPH_ID_SET(hdr, id) (hdr)->_id = (id) +#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) +#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = (htons(IPH_PROTO(hdr) | ((ttl) << 8))) +#define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = (htons((proto) | (IPH_TTL(hdr) << 8))) +#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) #if IP_DEBUG void ip_debug_print(struct pbuf *p); diff --git a/modules/network/SMSTCPIP/include/lwip/ip_addr.h b/modules/network/SMSTCPIP/include/lwip/ip_addr.h index ecc381441..f7ef6a2ed 100644 --- a/modules/network/SMSTCPIP/include/lwip/ip_addr.h +++ b/modules/network/SMSTCPIP/include/lwip/ip_addr.h @@ -37,10 +37,10 @@ /** IP_ADDR_ can be used as a fixed IP address * for the wildcard and the broadcast address */ -#define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) +#define IP_ADDR_ANY ((struct ip_addr *)&ip_addr_any) #define IP_ADDR_BROADCAST ((struct ip_addr *)&ip_addr_broadcast) -#define INADDR_NONE ((u32_t)0xffffffff) /* 255.255.255.255 */ +#define INADDR_NONE ((u32_t)0xffffffff) /* 255.255.255.255 */ #define INADDR_LOOPBACK ((u32_t)0x7f000001) /* 127.0.0.1 */ /* Definitions of the bits in an Internet address integer. @@ -48,31 +48,31 @@ On subnets, host and network parts are found according to the subnet mask, not these masks. */ -#define IN_CLASSA(a) ((((u32_t)(a)) & 0x80000000) == 0) -#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA(a) ((((u32_t)(a)) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 -#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) -#define IN_CLASSA_MAX 128 +#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) +#define IN_CLASSA_MAX 128 -#define IN_CLASSB(a) ((((u32_t)(a)) & 0xc0000000) == 0x80000000) -#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB(a) ((((u32_t)(a)) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 #define IN_CLASSB_NSHIFT 16 -#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) -#define IN_CLASSB_MAX 65536 +#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) +#define IN_CLASSB_MAX 65536 -#define IN_CLASSC(a) ((((u32_t)(a)) & 0xe0000000) == 0xc0000000) -#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC(a) ((((u32_t)(a)) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 -#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) +#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) -#define IN_CLASSD(a) (((u32_t)(a)&0xf0000000) == 0xe0000000) -#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ -#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ -#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ -#define IN_MULTICAST(a) IN_CLASSD(a) +#define IN_CLASSD(a) (((u32_t)(a)&0xf0000000) == 0xe0000000) +#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ +#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ +#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ +#define IN_MULTICAST(a) IN_CLASSD(a) #define IN_EXPERIMENTAL(a) (((u32_t)(a)&0xf0000000) == 0xf0000000) -#define IN_BADCLASS(a) (((u32_t)(a)&0xf0000000) == 0xf0000000) +#define IN_BADCLASS(a) (((u32_t)(a)&0xf0000000) == 0xf0000000) #define IN_LOOPBACKNET 127 /* official! */ diff --git a/modules/network/SMSTCPIP/include/lwip/netif.h b/modules/network/SMSTCPIP/include/lwip/netif.h index a87a5156a..f85ba9649 100644 --- a/modules/network/SMSTCPIP/include/lwip/netif.h +++ b/modules/network/SMSTCPIP/include/lwip/netif.h @@ -51,16 +51,16 @@ /** whether the network interface is 'up'. this is * a software flag used to control whether this network * interface is enabled and processes traffic */ -#define NETIF_FLAG_UP 0x1U +#define NETIF_FLAG_UP 0x1U /** if set, the netif has broadcast capability */ -#define NETIF_FLAG_BROADCAST 0x2U +#define NETIF_FLAG_BROADCAST 0x2U /** if set, the netif is one end of a point-to-point connection */ #define NETIF_FLAG_POINTTOPOINT 0x4U /** if set, the interface is configured using DHCP */ -#define NETIF_FLAG_DHCP 0x08U +#define NETIF_FLAG_DHCP 0x08U /** if set, the interface has an active link * (set by the interface) */ -#define NETIF_FLAG_LINK_UP 0x10U +#define NETIF_FLAG_LINK_UP 0x10U /** generic data structure used for all lwIP network interfaces */ struct netif diff --git a/modules/network/SMSTCPIP/include/lwip/opt.h b/modules/network/SMSTCPIP/include/lwip/opt.h index 1843e1406..571b5eeb3 100644 --- a/modules/network/SMSTCPIP/include/lwip/opt.h +++ b/modules/network/SMSTCPIP/include/lwip/opt.h @@ -62,7 +62,7 @@ * Your system should provide mutexes supporting priority inversion to use this. */ #if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__ -#define LWIP_TCPIP_CORE_LOCKING 1 +#define LWIP_TCPIP_CORE_LOCKING 1 #endif /** @@ -74,7 +74,7 @@ * interrupt context! */ #if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__ -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 +#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 #endif /* ---------- Memory options ---------- */ /** @@ -338,10 +338,10 @@ a lot of data that needs to be copied, this should be set high. */ #endif #ifndef LWIP_EVENT_API -#define LWIP_EVENT_API 0 +#define LWIP_EVENT_API 0 #define LWIP_CALLBACK_API 1 #else -#define LWIP_EVENT_API 1 +#define LWIP_EVENT_API 1 #define LWIP_CALLBACK_API 0 #endif @@ -427,17 +427,17 @@ a lot of data that needs to be copied, this should be set high. */ #else -#define LINK_STATS 0 -#define IP_STATS 0 +#define LINK_STATS 0 +#define IP_STATS 0 #define IPFRAG_STATS 0 -#define ICMP_STATS 0 -#define UDP_STATS 0 -#define TCP_STATS 0 -#define MEM_STATS 0 -#define MEMP_STATS 0 -#define PBUF_STATS 0 -#define SYS_STATS 0 -#define RAW_STATS 0 +#define ICMP_STATS 0 +#define UDP_STATS 0 +#define TCP_STATS 0 +#define MEM_STATS 0 +#define MEMP_STATS 0 +#define PBUF_STATS 0 +#define SYS_STATS 0 +#define RAW_STATS 0 #endif /* LWIP_STATS */ @@ -462,8 +462,8 @@ a lot of data that needs to be copied, this should be set high. */ #endif #define MSCHAP_SUPPORT 0 /* Set for MSCHAP (NOT FUNCTIONAL!) */ -#define CBCP_SUPPORT 0 /* Set for CBCP (NOT FUNCTIONAL!) */ -#define CCP_SUPPORT 0 /* Set for CCP (NOT FUNCTIONAL!) */ +#define CBCP_SUPPORT 0 /* Set for CBCP (NOT FUNCTIONAL!) */ +#define CCP_SUPPORT 0 /* Set for CCP (NOT FUNCTIONAL!) */ #ifndef VJ_SUPPORT #define VJ_SUPPORT 0 /* Set for VJ header compression. */ @@ -477,7 +477,7 @@ a lot of data that needs to be copied, this should be set high. */ /* * Timeouts. */ -#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ +#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ #define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ #define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ #define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ @@ -485,7 +485,7 @@ a lot of data that needs to be copied, this should be set high. */ #define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ #define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ -#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ +#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ #define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ @@ -517,13 +517,13 @@ a lot of data that needs to be copied, this should be set high. */ #define PPP_MAXMTU 1500 /* Largest MTU we allow */ #endif #define PPP_MINMTU 64 -#define PPP_MRU 1500 /* default MRU = max length of info field */ +#define PPP_MRU 1500 /* default MRU = max length of info field */ #define PPP_MAXMRU 1500 /* Largest MRU we allow */ #define PPP_DEFMRU 296 /* Try for this */ #define PPP_MINMRU 128 /* No MRUs below this */ -#define MAXNAMELEN 256 /* max length of hostname or name for auth */ +#define MAXNAMELEN 256 /* max length of hostname or name for auth */ #define MAXSECRETLEN 256 /* max length of password or secret */ #endif /* PPP_SUPPORT */ @@ -665,28 +665,28 @@ a lot of data that needs to be copied, this should be set high. */ * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. */ #if !defined CHECKSUM_CHECK_IP -#define CHECKSUM_CHECK_IP 1 +#define CHECKSUM_CHECK_IP 1 #endif /** * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. */ #if !defined CHECKSUM_CHECK_UDP -#define CHECKSUM_CHECK_UDP 1 +#define CHECKSUM_CHECK_UDP 1 #endif /** * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. */ #if !defined CHECKSUM_CHECK_TCP -#define CHECKSUM_CHECK_TCP 1 +#define CHECKSUM_CHECK_TCP 1 #endif /** * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. */ #if !defined CHECKSUM_CHECK_ICMP -#define CHECKSUM_CHECK_ICMP 1 +#define CHECKSUM_CHECK_ICMP 1 #endif #endif /* __LWIP_OPT_H__ */ diff --git a/modules/network/SMSTCPIP/include/lwip/pbuf.h b/modules/network/SMSTCPIP/include/lwip/pbuf.h index 6982e8df6..2fbac695c 100644 --- a/modules/network/SMSTCPIP/include/lwip/pbuf.h +++ b/modules/network/SMSTCPIP/include/lwip/pbuf.h @@ -37,7 +37,7 @@ #define PBUF_TRANSPORT_HLEN 20 -#define PBUF_IP_HLEN 20 +#define PBUF_IP_HLEN 20 typedef enum { PBUF_TRANSPORT, @@ -55,10 +55,10 @@ typedef enum { /* Definitions for the pbuf flag field (these are not the flags that are passed to pbuf_alloc()). */ -#define PBUF_FLAG_RAM 0x00U /* Flags that pbuf data is stored in RAM */ -#define PBUF_FLAG_ROM 0x01U /* Flags that pbuf data is stored in ROM */ +#define PBUF_FLAG_RAM 0x00U /* Flags that pbuf data is stored in RAM */ +#define PBUF_FLAG_ROM 0x01U /* Flags that pbuf data is stored in ROM */ #define PBUF_FLAG_POOL 0x02U /* Flags that the pbuf comes from the pbuf pool */ -#define PBUF_FLAG_REF 0x04U /* Flags thet the pbuf payload refers to RAM */ +#define PBUF_FLAG_REF 0x04U /* Flags thet the pbuf payload refers to RAM */ /** indicates this packet was broadcast on the link */ #define PBUF_FLAG_LINK_BROADCAST 0x80U diff --git a/modules/network/SMSTCPIP/include/lwip/sockets.h b/modules/network/SMSTCPIP/include/lwip/sockets.h index f0d7933ce..cf1d3795f 100644 --- a/modules/network/SMSTCPIP/include/lwip/sockets.h +++ b/modules/network/SMSTCPIP/include/lwip/sockets.h @@ -58,36 +58,36 @@ struct sockaddr #define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 /* * Option flags per-socket. */ -#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ +#define SO_DEBUG 0x0001 /* turn on debugging info recording */ +#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ +#define SO_REUSEADDR 0x0004 /* allow local address reuse */ +#define SO_KEEPALIVE 0x0008 /* keep connections alive */ +#define SO_DONTROUTE 0x0010 /* just use interface addresses */ +#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ #define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ -#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ +#define SO_LINGER 0x0080 /* linger on close if data present */ +#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ +#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ #define SO_DONTLINGER (int)(~SO_LINGER) /* * Additional options, not kept in so_options. */ -#define SO_SNDBUF 0x1001 /* send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDBUF 0x1001 /* send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ #define SO_SNDLOWAT 0x1003 /* send low-water mark */ #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ #define SO_SNDTIMEO 0x1005 /* send timeout */ #define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ @@ -107,15 +107,15 @@ struct linger #define AF_UNSPEC 0 -#define AF_INET 2 -#define PF_INET AF_INET +#define AF_INET 2 +#define PF_INET AF_INET #define PF_UNSPEC AF_UNSPEC -#define IPPROTO_IP 0 +#define IPPROTO_IP 0 #define IPPROTO_TCP 6 #define IPPROTO_UDP 17 -#define INADDR_ANY 0 +#define INADDR_ANY 0 #define INADDR_BROADCAST 0xffffffff /* Flags we can use with send and recv. */ @@ -129,27 +129,27 @@ struct linger #define IP_TTL 2 -#define IPTOS_TOS_MASK 0x1E -#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK) -#define IPTOS_LOWDELAY 0x10 -#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_TOS_MASK 0x1E +#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK) +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 #define IPTOS_RELIABILITY 0x04 -#define IPTOS_LOWCOST 0x02 -#define IPTOS_MINCOST IPTOS_LOWCOST +#define IPTOS_LOWCOST 0x02 +#define IPTOS_MINCOST IPTOS_LOWCOST /* * Definitions for IP precedence (also in ip_tos) (hopefully unused) */ -#define IPTOS_PREC_MASK 0xe0 -#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK) -#define IPTOS_PREC_NETCONTROL 0xe0 +#define IPTOS_PREC_MASK 0xe0 +#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK) +#define IPTOS_PREC_NETCONTROL 0xe0 #define IPTOS_PREC_INTERNETCONTROL 0xc0 -#define IPTOS_PREC_CRITIC_ECP 0xa0 -#define IPTOS_PREC_FLASHOVERRIDE 0x80 -#define IPTOS_PREC_FLASH 0x60 -#define IPTOS_PREC_IMMEDIATE 0x40 -#define IPTOS_PREC_PRIORITY 0x20 -#define IPTOS_PREC_ROUTINE 0x00 +#define IPTOS_PREC_CRITIC_ECP 0xa0 +#define IPTOS_PREC_FLASHOVERRIDE 0x80 +#define IPTOS_PREC_FLASH 0x60 +#define IPTOS_PREC_IMMEDIATE 0x40 +#define IPTOS_PREC_PRIORITY 0x20 +#define IPTOS_PREC_ROUTINE 0x00 /* @@ -163,14 +163,14 @@ struct linger * we restrict parameters to at most 128 bytes. */ #if !defined(FIONREAD) || !defined(FIONBIO) -#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000 /* no parameters */ -#define IOC_OUT 0x40000000 /* copy out parameters */ -#define IOC_IN 0x80000000 /* copy in parameters */ -#define IOC_INOUT (IOC_IN | IOC_OUT) +#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ +#define IOC_VOID 0x20000000 /* no parameters */ +#define IOC_OUT 0x40000000 /* copy out parameters */ +#define IOC_IN 0x80000000 /* copy in parameters */ +#define IOC_INOUT (IOC_IN | IOC_OUT) /* 0x20000000 distinguishes new & old ioctl's */ -#define _IO(x, y) (IOC_VOID | ((x) << 8) | (y)) +#define _IO(x, y) (IOC_VOID | ((x) << 8) | (y)) #define _IOR(x, y, t) (IOC_OUT | (((long)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y)) @@ -199,11 +199,11 @@ struct linger #ifndef FD_SET #undef FD_SETSIZE -#define FD_SETSIZE 16 -#define FD_SET(n, p) ((p)->fd_bits[(n) / 8] |= (1 << ((n)&7))) -#define FD_CLR(n, p) ((p)->fd_bits[(n) / 8] &= ~(1 << ((n)&7))) +#define FD_SETSIZE 16 +#define FD_SET(n, p) ((p)->fd_bits[(n) / 8] |= (1 << ((n)&7))) +#define FD_CLR(n, p) ((p)->fd_bits[(n) / 8] &= ~(1 << ((n)&7))) #define FD_ISSET(n, p) ((p)->fd_bits[(n) / 8] & (1 << ((n)&7))) -#define FD_ZERO(p) mips_memset((void *)(p), 0, sizeof(*(p))) +#define FD_ZERO(p) mips_memset((void *)(p), 0, sizeof(*(p))) typedef struct fd_set { @@ -235,25 +235,25 @@ int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptse int lwip_ioctl(int s, long cmd, void *argp); #if LWIP_COMPAT_SOCKETS -#define accept(a, b, c) lwip_accept(a, b, c) -#define bind(a, b, c) lwip_bind(a, b, c) -#define shutdown(a, b) lwip_shutdown(a, b) -#define close(s) lwip_close(s) -#define connect(a, b, c) lwip_connect(a, b, c) -#define getsockname(a, b, c) lwip_getsockname(a, b, c) -#define getpeername(a, b, c) lwip_getpeername(a, b, c) -#define setsockopt(a, b, c, d, e) lwip_setsockopt(a, b, c, d, e) -#define getsockopt(a, b, c, d, e) lwip_getsockopt(a, b, c, d, e) -#define listen(a, b) lwip_listen(a, b) -#define recv(a, b, c, d) lwip_recv(a, b, c, d) -#define read(a, b, c) lwip_read(a, b, c) +#define accept(a, b, c) lwip_accept(a, b, c) +#define bind(a, b, c) lwip_bind(a, b, c) +#define shutdown(a, b) lwip_shutdown(a, b) +#define close(s) lwip_close(s) +#define connect(a, b, c) lwip_connect(a, b, c) +#define getsockname(a, b, c) lwip_getsockname(a, b, c) +#define getpeername(a, b, c) lwip_getpeername(a, b, c) +#define setsockopt(a, b, c, d, e) lwip_setsockopt(a, b, c, d, e) +#define getsockopt(a, b, c, d, e) lwip_getsockopt(a, b, c, d, e) +#define listen(a, b) lwip_listen(a, b) +#define recv(a, b, c, d) lwip_recv(a, b, c, d) +#define read(a, b, c) lwip_read(a, b, c) #define recvfrom(a, b, c, d, e, f, g, h) lwip_recvfrom(a, b, c, d, e, f, g, h) -#define send(a, b, c, d) lwip_send(a, b, c, d) -#define sendto(a, b, c, d, e, f) lwip_sendto(a, b, c, d, e, f) -#define socket(a, b, c) lwip_socket(a, b, c) -#define write(a, b, c) lwip_write(a, b, c) -#define select(a, b, c, d, e) lwip_select(a, b, c, d, e) -#define ioctlsocket(a, b, c) lwip_ioctl(a, b, c) +#define send(a, b, c, d) lwip_send(a, b, c, d) +#define sendto(a, b, c, d, e, f) lwip_sendto(a, b, c, d, e, f) +#define socket(a, b, c) lwip_socket(a, b, c) +#define write(a, b, c) lwip_write(a, b, c) +#define select(a, b, c, d, e) lwip_select(a, b, c, d, e) +#define ioctlsocket(a, b, c) lwip_ioctl(a, b, c) #endif /* LWIP_COMPAT_SOCKETS */ #endif /* __LWIP_SOCKETS_H__ */ diff --git a/modules/network/SMSTCPIP/include/lwip/sys.h b/modules/network/SMSTCPIP/include/lwip/sys.h index 6899c8fe1..16872ae4d 100644 --- a/modules/network/SMSTCPIP/include/lwip/sys.h +++ b/modules/network/SMSTCPIP/include/lwip/sys.h @@ -73,11 +73,11 @@ struct sys_timeout sys_sem_t sys_sem_new(u8_t count); //void sys_sem_signal(sys_sem_t sem); -#define sys_sem_signal(s) SignalSema(s) +#define sys_sem_signal(s) SignalSema(s) u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout); void sys_sem_free(sys_sem_t sem); -#define sys_sem_wait(s) WaitSema(s) +#define sys_sem_wait(s) WaitSema(s) #define sys_sem_wait_timeout(s, t) (sys_arch_sem_wait(s, t) != SYS_ARCH_TIMEOUT) /* Mailbox functions. */ @@ -85,7 +85,7 @@ sys_mbox_t sys_mbox_new(void); void sys_mbox_post(sys_mbox_t mbox, void *msg); u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout); void sys_mbox_free(sys_mbox_t mbox); -#define sys_mbox_fetch(mb, msg) sys_arch_mbox_fetch((mb), (msg), 0); +#define sys_mbox_fetch(mb, msg) sys_arch_mbox_fetch((mb), (msg), 0); /* Thread functions. */ @@ -126,7 +126,7 @@ unsigned long sys_now(void); * which should be implemented in sys_arch.c. If a particular port needs a * different implementation, then this macro may be defined in sys_arch.h */ -#define SYS_ARCH_PROTECT(lev) CpuSuspendIntr(&lev) +#define SYS_ARCH_PROTECT(lev) CpuSuspendIntr(&lev) //lev = sys_arch_protect() /** SYS_ARCH_UNPROTECT * Perform a "fast" set of the protection level to "lev". This could be @@ -136,7 +136,7 @@ unsigned long sys_now(void); * sys_arch.c. If a particular port needs a different implementation, then * this macro may be defined in sys_arch.h */ -#define SYS_ARCH_UNPROTECT(lev) CpuResumeIntr(lev) +#define SYS_ARCH_UNPROTECT(lev) CpuResumeIntr(lev) //sys_arch_unprotect(lev) //sys_prot_t sys_arch_protect(void); //void sys_arch_unprotect(sys_prot_t pval); @@ -152,39 +152,43 @@ unsigned long sys_now(void); #endif /* SYS_ARCH_PROTECT */ #ifndef SYS_ARCH_INC -#define SYS_ARCH_INC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var += val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) +#define SYS_ARCH_INC(var, val) \ + do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + var += val; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while (0) #endif /* SYS_ARCH_INC */ #ifndef SYS_ARCH_DEC -#define SYS_ARCH_DEC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var -= val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) +#define SYS_ARCH_DEC(var, val) \ + do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + var -= val; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while (0) #endif /* SYS_ARCH_DEC */ #ifndef SYS_ARCH_GET -#define SYS_ARCH_GET(var, ret) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - ret = var; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) +#define SYS_ARCH_GET(var, ret) \ + do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + ret = var; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while (0) #endif /* SYS_ARCH_GET */ #ifndef SYS_ARCH_SET -#define SYS_ARCH_SET(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var = val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) +#define SYS_ARCH_SET(var, val) \ + do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + var = val; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while (0) #endif /* SYS_ARCH_SET */ #endif /* __LWIP_SYS_H__ */ diff --git a/modules/network/SMSTCPIP/include/lwip/tcp.h b/modules/network/SMSTCPIP/include/lwip/tcp.h index 71ab736bd..74b8ed780 100644 --- a/modules/network/SMSTCPIP/include/lwip/tcp.h +++ b/modules/network/SMSTCPIP/include/lwip/tcp.h @@ -76,16 +76,14 @@ void tcp_poll(struct tcp_pcb *pcb, void tcp_err(struct tcp_pcb *pcb, void (*err)(void *arg, err_t err)); -#define tcp_mss(pcb) ((pcb)->mss) +#define tcp_mss(pcb) ((pcb)->mss) #define tcp_sndbuf(pcb) ((pcb)->snd_buf) void tcp_recved(struct tcp_pcb *pcb, u16_t len); err_t tcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port); err_t tcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, - u16_t port, err_t (*connected)(void *arg, - struct tcp_pcb *tpcb, - err_t err)); + u16_t port, err_t (*connected)(void *arg, struct tcp_pcb *tpcb, err_t err)); struct tcp_pcb *tcp_listen(struct tcp_pcb *pcb); void tcp_abort(struct tcp_pcb *pcb); err_t tcp_close(struct tcp_pcb *pcb); @@ -94,9 +92,9 @@ err_t tcp_write(struct tcp_pcb *pcb, const void *dataptr, u16_t len, #define tcp_setprio(pcb, prio) pcb->prio = (prio) -#define TCP_PRIO_MIN 1 +#define TCP_PRIO_MIN 1 #define TCP_PRIO_NORMAL 64 -#define TCP_PRIO_MAX 127 +#define TCP_PRIO_MAX 127 /* It is also possible to call these two functions at the right intervals (instead of calling tcp_tmr()). */ @@ -112,9 +110,9 @@ void tcp_rexmit(struct tcp_pcb *pcb); -#define TCP_SEQ_LT(a, b) ((s32_t)((a) - (b)) < 0) +#define TCP_SEQ_LT(a, b) ((s32_t)((a) - (b)) < 0) #define TCP_SEQ_LEQ(a, b) ((s32_t)((a) - (b)) <= 0) -#define TCP_SEQ_GT(a, b) ((s32_t)((a) - (b)) > 0) +#define TCP_SEQ_GT(a, b) ((s32_t)((a) - (b)) > 0) #define TCP_SEQ_GEQ(a, b) ((s32_t)((a) - (b)) >= 0) #define TCP_FIN 0x01U @@ -156,16 +154,16 @@ void tcp_rexmit(struct tcp_pcb *pcb); /* * User-settable options (used with setsockopt, IPPROTO_TCP level). */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keepalive miliseconds */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keepalive miliseconds */ #define TCP_ACKNODELAY 0x04 /* send ack as soon as data is received [not standard] */ -#define TCP_EVENSEG 0x08 /* Boman666 patch: send an even number of segments [not standard] */ +#define TCP_EVENSEG 0x08 /* Boman666 patch: send an even number of segments [not standard] */ /* Keepalive values */ -#define TCP_KEEPDEFAULT 7200000 /* KEEPALIVE timer in miliseconds */ -#define TCP_KEEPINTVL 75000 /* Time between KEEPALIVE probes in miliseconds */ -#define TCP_KEEPCNT 9 /* Counter for KEEPALIVE probes */ -#define TCP_MAXIDLE TCP_KEEPCNT *TCP_KEEPINTVL /* Maximum KEEPALIVE probe time */ +#define TCP_KEEPDEFAULT 7200000 /* KEEPALIVE timer in miliseconds */ +#define TCP_KEEPINTVL 75000 /* Time between KEEPALIVE probes in miliseconds */ +#define TCP_KEEPCNT 9 /* Counter for KEEPALIVE probes */ +#define TCP_MAXIDLE TCP_KEEPCNT *TCP_KEEPINTVL /* Maximum KEEPALIVE probe time */ #ifdef PACK_STRUCT_USE_INCLUDES @@ -190,13 +188,13 @@ PACK_STRUCT_END #define TCPH_OFFSET(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 8) #define TCPH_HDRLEN(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 12) -#define TCPH_FLAGS(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS) +#define TCPH_FLAGS(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS) #define TCPH_OFFSET_SET(phdr, offset) (phdr)->_hdrlen_rsvd_flags = htons(((offset) << 8) | TCPH_FLAGS(phdr)) -#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | TCPH_FLAGS(phdr)) -#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons((ntohs((phdr)->_hdrlen_rsvd_flags) & ~TCP_FLAGS) | (flags)) -#define TCPH_SET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (flags)) -#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (TCPH_FLAGS(phdr) & ~(flags))) +#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | TCPH_FLAGS(phdr)) +#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons((ntohs((phdr)->_hdrlen_rsvd_flags) & ~TCP_FLAGS) | (flags)) +#define TCPH_SET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (flags)) +#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (TCPH_FLAGS(phdr) & ~(flags))) #define TCP_TCPLEN(seg) ((seg)->len + ((TCPH_FLAGS((seg)->tcphdr) & TCP_FIN || \ TCPH_FLAGS((seg)->tcphdr) & TCP_SYN) ? \ @@ -240,15 +238,15 @@ struct tcp_pcb u8_t flags; */ #define flags_t /*u8_t*/ u16_t flags_t flags; -#define TF_ACK_DELAY (flags_t)0x01U /* Delayed ACK. */ -#define TF_ACK_NOW (flags_t)0x02U /* Immediate ACK. */ -#define TF_INFR (flags_t)0x04U /* In fast recovery. */ -#define TF_RESET (flags_t)0x08U /* Connection was reset. */ -#define TF_CLOSED (flags_t)0x10U /* Connection was sucessfully closed. */ -#define TF_GOT_FIN (flags_t)0x20U /* Connection was closed by the remote end. */ -#define TF_NODELAY (flags_t)0x40U /* Disable Nagle algorithm */ -#define TF_ACKNODELAY (flags_t)0x80U /* Force ACK at every receive [not standard] */ -#define TF_EVENSEG (flags_t)0x100U /* Send an even number of segment [not standard] */ +#define TF_ACK_DELAY (flags_t)0x01U /* Delayed ACK. */ +#define TF_ACK_NOW (flags_t)0x02U /* Immediate ACK. */ +#define TF_INFR (flags_t)0x04U /* In fast recovery. */ +#define TF_RESET (flags_t)0x08U /* Connection was reset. */ +#define TF_CLOSED (flags_t)0x10U /* Connection was sucessfully closed. */ +#define TF_GOT_FIN (flags_t)0x20U /* Connection was closed by the remote end. */ +#define TF_NODELAY (flags_t)0x40U /* Disable Nagle algorithm */ +#define TF_ACKNODELAY (flags_t)0x80U /* Force ACK at every receive [not standard] */ +#define TF_EVENSEG (flags_t)0x100U /* Send an even number of segment [not standard] */ /* receiver varables */ u32_t rcv_nxt; /* next seqno expected */ diff --git a/modules/network/SMSTCPIP/include/lwip/tcpip.h b/modules/network/SMSTCPIP/include/lwip/tcpip.h index 4f93c2cf4..18c496eba 100644 --- a/modules/network/SMSTCPIP/include/lwip/tcpip.h +++ b/modules/network/SMSTCPIP/include/lwip/tcpip.h @@ -40,14 +40,14 @@ /** The global semaphore to lock the stack. */ extern sys_sem_t lock_tcpip_core; /** Lock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */ -#define LOCK_TCPIP_CORE() sys_sem_wait(lock_tcpip_core) +#define LOCK_TCPIP_CORE() sys_sem_wait(lock_tcpip_core) /** Unlock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */ -#define UNLOCK_TCPIP_CORE() sys_sem_signal(lock_tcpip_core) +#define UNLOCK_TCPIP_CORE() sys_sem_signal(lock_tcpip_core) #define TCPIP_APIMSG_ACK(m) #else /* LWIP_TCPIP_CORE_LOCKING */ #define LOCK_TCPIP_CORE() #define UNLOCK_TCPIP_CORE() -#define TCPIP_APIMSG_ACK(m) sys_mbox_post(m, NULL) +#define TCPIP_APIMSG_ACK(m) sys_mbox_post(m, NULL) #endif /* LWIP_TCPIP_CORE_LOCKING */ void tcpip_init(void (*tcpip_init_done)(void *), void *arg); diff --git a/modules/network/SMSTCPIP/include/lwip/timers.h b/modules/network/SMSTCPIP/include/lwip/timers.h index 4cd8810d8..07d681a92 100644 --- a/modules/network/SMSTCPIP/include/lwip/timers.h +++ b/modules/network/SMSTCPIP/include/lwip/timers.h @@ -62,24 +62,25 @@ extern "C" { * * @param arg Additional argument to pass to the function - set up by sys_timeout() */ -typedef void (* sys_timeout_handler)(void *arg); +typedef void (*sys_timeout_handler)(void *arg); -struct sys_timeo { - struct sys_timeo *next; - u32_t time; - sys_timeout_handler h; - void *arg; +struct sys_timeo +{ + struct sys_timeo *next; + u32_t time; + sys_timeout_handler h; + void *arg; #if LWIP_DEBUG_TIMERNAMES - const char* handler_name; + const char *handler_name; #endif /* LWIP_DEBUG_TIMERNAMES */ }; void sys_timeouts_init(void); #if LWIP_DEBUG_TIMERNAMES -void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name); +void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char *handler_name); #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) -#else /* LWIP_DEBUG_TIMERNAMES */ +#else /* LWIP_DEBUG_TIMERNAMES */ void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg); #endif /* LWIP_DEBUG_TIMERNAMES */ @@ -87,7 +88,7 @@ void sys_untimeout(sys_timeout_handler handler, void *arg); #if NO_SYS void sys_check_timeouts(void); void sys_restart_timeouts(void); -#else /* NO_SYS */ +#else /* NO_SYS */ void sys_timeouts_mbox_fetch(sys_mbox_t mbox, void **msg); #endif /* NO_SYS */ diff --git a/modules/network/SMSTCPIP/include/lwip/udp.h b/modules/network/SMSTCPIP/include/lwip/udp.h index 59b6d3052..30f556d6c 100644 --- a/modules/network/SMSTCPIP/include/lwip/udp.h +++ b/modules/network/SMSTCPIP/include/lwip/udp.h @@ -48,8 +48,8 @@ struct udp_hdr PACK_STRUCT_FIELD(u16_t chksum); } PACK_STRUCT_STRUCT; -#define UDP_FLAGS_NOCHKSUM 0x01U -#define UDP_FLAGS_UDPLITE 0x02U +#define UDP_FLAGS_NOCHKSUM 0x01U +#define UDP_FLAGS_UDPLITE 0x02U #define UDP_FLAGS_CONNECTED 0x04U struct udp_pcb @@ -88,7 +88,7 @@ void udp_recv(struct udp_pcb *pcb, void *recv_arg); err_t udp_send(struct udp_pcb *pcb, struct pbuf *p); -#define udp_flags(pcb) ((pcb)->flags) +#define udp_flags(pcb) ((pcb)->flags) #define udp_setflags(pcb, f) ((pcb)->flags = (f)) diff --git a/modules/network/SMSTCPIP/include/lwipopts.h b/modules/network/SMSTCPIP/include/lwipopts.h index 0be5df272..49469c4b0 100644 --- a/modules/network/SMSTCPIP/include/lwipopts.h +++ b/modules/network/SMSTCPIP/include/lwipopts.h @@ -121,7 +121,7 @@ a lot of data that needs to be copied, this should be set high. */ /* ---------- TCP options ---------- */ #define LWIP_TCP 1 -#define TCP_TTL 255 +#define TCP_TTL 255 /* Controls if TCP should queue segments that arrive out of order. Define to 0 if your device is low on memory. */ @@ -182,7 +182,7 @@ a lot of data that needs to be copied, this should be set high. */ /* IP reassembly and segmentation. These are orthogonal even if they both deal with IP fragments */ #define IP_REASSEMBLY 1 -#define IP_FRAG 1 +#define IP_FRAG 1 /* ---------- ICMP options ---------- */ #define ICMP_TTL 255 @@ -200,11 +200,11 @@ a lot of data that needs to be copied, this should be set high. */ /** * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. */ -#define DHCP_DOES_ARP_CHECK 0 //Don't do the ARP check because an IP address would be first required. +#define DHCP_DOES_ARP_CHECK 0 //Don't do the ARP check because an IP address would be first required. #else -#define LWIP_DHCP 0 +#define LWIP_DHCP 0 #define DHCP_DOES_ARP_CHECK 0 #endif @@ -222,17 +222,17 @@ a lot of data that needs to be copied, this should be set high. */ #define LWIP_STATS 0 #if LWIP_STATS -#define LINK_STATS 1 -#define IP_STATS 1 +#define LINK_STATS 1 +#define IP_STATS 1 #define IPFRAG_STATS 1 -#define ICMP_STATS 1 -#define UDP_STATS 1 -#define TCP_STATS 1 -#define MEM_STATS 1 -#define MEMP_STATS 1 -#define PBUF_STATS 1 -#define SYS_STATS 1 -#define RAW_STATS 1 +#define ICMP_STATS 1 +#define UDP_STATS 1 +#define TCP_STATS 1 +#define MEM_STATS 1 +#define MEMP_STATS 1 +#define PBUF_STATS 1 +#define SYS_STATS 1 +#define RAW_STATS 1 #endif /*LWIP_STATS*/ //Boman666: This define will force the TX-data to be splitted in an even number of TCP-segments. This will significantly increase @@ -299,28 +299,28 @@ a lot of data that needs to be copied, this should be set high. */ * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. */ #if !defined CHECKSUM_CHECK_IP -#define CHECKSUM_CHECK_IP 0 +#define CHECKSUM_CHECK_IP 0 #endif /** * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. */ #if !defined CHECKSUM_CHECK_UDP -#define CHECKSUM_CHECK_UDP 0 +#define CHECKSUM_CHECK_UDP 0 #endif /** * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. */ #if !defined CHECKSUM_CHECK_TCP -#define CHECKSUM_CHECK_TCP 0 +#define CHECKSUM_CHECK_TCP 0 #endif /** * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. */ #if !defined CHECKSUM_CHECK_ICMP -#define CHECKSUM_CHECK_ICMP 0 +#define CHECKSUM_CHECK_ICMP 0 #endif #endif diff --git a/modules/network/SMSTCPIP/include/netif/etharp.h b/modules/network/SMSTCPIP/include/netif/etharp.h index e6f125ed0..97a8bf6d8 100644 --- a/modules/network/SMSTCPIP/include/netif/etharp.h +++ b/modules/network/SMSTCPIP/include/netif/etharp.h @@ -86,7 +86,7 @@ struct ethip_hdr #define ARP_TMR_INTERVAL 10000 #define ETHTYPE_ARP 0x0608 -#define ETHTYPE_IP 0x0008 +#define ETHTYPE_IP 0x0008 void etharp_init(void); void etharp_tmr(void); diff --git a/modules/network/SMSTCPIP/ip.c b/modules/network/SMSTCPIP/ip.c index fba232612..a82ab6ffc 100644 --- a/modules/network/SMSTCPIP/ip.c +++ b/modules/network/SMSTCPIP/ip.c @@ -244,8 +244,7 @@ err_t ip_input(struct pbuf *p, struct netif *inp) if (!ip_addr_isany(&netif->ip_addr)) { - if (ip_addr_cmp(&iphdr->dest, &netif->ip_addr) || (ip_addr_isbroadcast(&iphdr->dest, &netif->netmask) && - ip_addr_maskcmp(&iphdr->dest, &netif->ip_addr, &netif->netmask)) || + if (ip_addr_cmp(&iphdr->dest, &netif->ip_addr) || (ip_addr_isbroadcast(&iphdr->dest, &netif->netmask) && ip_addr_maskcmp(&iphdr->dest, &netif->ip_addr, &netif->netmask)) || ip_addr_cmp(&iphdr->dest, IP_ADDR_BROADCAST)) break; diff --git a/modules/network/SMSTCPIP/ip_frag.c b/modules/network/SMSTCPIP/ip_frag.c index 26818cd56..6a3983c24 100644 --- a/modules/network/SMSTCPIP/ip_frag.c +++ b/modules/network/SMSTCPIP/ip_frag.c @@ -80,8 +80,8 @@ static struct pbuf *copy_from_pbuf( } /* end copy_from_pbuf */ #define IP_REASS_BUFSIZE 5760 -#define IP_REASS_MAXAGE 30 -#define IP_REASS_TMO 250 +#define IP_REASS_MAXAGE 30 +#define IP_REASS_TMO 250 static iop_sys_clock_t s_Clock = { 0x01194000, 0x00000000}; diff --git a/modules/network/SMSTCPIP/loopif.c b/modules/network/SMSTCPIP/loopif.c index 6ec1ac0a5..c75a7f023 100644 --- a/modules/network/SMSTCPIP/loopif.c +++ b/modules/network/SMSTCPIP/loopif.c @@ -76,7 +76,7 @@ loopif_output(struct netif *netif, struct pbuf *p, ptr += q->len; } - arg = mem_malloc(sizeof(void * [2])); + arg = mem_malloc(sizeof(void *[2])); if (NULL == arg) { return ERR_MEM; } diff --git a/modules/network/SMSTCPIP/ps2ip.c b/modules/network/SMSTCPIP/ps2ip.c index b2391000b..941c8eb92 100644 --- a/modules/network/SMSTCPIP/ps2ip.c +++ b/modules/network/SMSTCPIP/ps2ip.c @@ -35,7 +35,7 @@ #include "ps2ip_internal.h" #include "arch/sys_arch.h" -#define SYS_MBOX_SIZE 64 +#define SYS_MBOX_SIZE 64 #define SYS_THREAD_PRIO_BASE TCPIP_THREAD_PRIO struct sys_mbox_msg @@ -468,24 +468,24 @@ sys_sem_t sys_sem_new(u8_t aCount) } /* end sys_sem_new */ -static unsigned int TimeoutHandler(void* pvArg) +static unsigned int TimeoutHandler(void *pvArg) { iReleaseWaitThread((int)pvArg); return 0; } -static u32_t ComputeTimeDiff(const iop_sys_clock_t* pStart, const iop_sys_clock_t* pEnd) +static u32_t ComputeTimeDiff(const iop_sys_clock_t *pStart, const iop_sys_clock_t *pEnd) { iop_sys_clock_t Diff; u32 iSec, iUSec, iDiff; - Diff.lo = pEnd->lo-pStart->lo; - Diff.hi = pEnd->hi-pStart->hi - (pStart->lo>pEnd->lo); + Diff.lo = pEnd->lo - pStart->lo; + Diff.hi = pEnd->hi - pStart->hi - (pStart->lo > pEnd->lo); SysClock2USec(&Diff, &iSec, &iUSec); - iDiff=(iSec * 1000) + (iUSec / 1000); + iDiff = (iSec * 1000) + (iUSec / 1000); - return((iDiff != 0) ? iDiff : 1); + return ((iDiff != 0) ? iDiff : 1); } u32_t sys_arch_sem_wait(sys_sem_t aSema, u32_t aTimeout) @@ -493,9 +493,9 @@ u32_t sys_arch_sem_wait(sys_sem_t aSema, u32_t aTimeout) u32 WaitTime; if (aTimeout == 0) - return(WaitSema(aSema) == 0 ? 0 : SYS_ARCH_TIMEOUT); + return (WaitSema(aSema) == 0 ? 0 : SYS_ARCH_TIMEOUT); else if (aTimeout == 1) - return(PollSema(aSema) == 0 ? 0 : SYS_ARCH_TIMEOUT); + return (PollSema(aSema) == 0 ? 0 : SYS_ARCH_TIMEOUT); else { iop_sys_clock_t lTimeout; @@ -513,7 +513,7 @@ u32_t sys_arch_sem_wait(sys_sem_t aSema, u32_t aTimeout) WaitTime = ComputeTimeDiff(&Start, &End); if (WaitTime > aTimeout) - WaitTime = aTimeout; + WaitTime = aTimeout; } else WaitTime = SYS_ARCH_TIMEOUT; diff --git a/modules/network/SMSTCPIP/sockets.c b/modules/network/SMSTCPIP/sockets.c index b42478739..bfd5d409e 100644 --- a/modules/network/SMSTCPIP/sockets.c +++ b/modules/network/SMSTCPIP/sockets.c @@ -500,7 +500,7 @@ int lwip_send(int s, void *data, int size, unsigned int flags) /* make the buffer point to the data that should be sent */ - if ((err = netbuf_ref(buf, data, size))==ERR_OK) { + if ((err = netbuf_ref(buf, data, size)) == ERR_OK) { /* send the data */ err = netconn_send(sock->conn, buf); } @@ -1356,7 +1356,7 @@ int lwip_ioctl(int s, long cmd, void *argp) return -1; } - SYS_ARCH_GET(sock->conn->recv_avail, *((u16_t*)argp)); + SYS_ARCH_GET(sock->conn->recv_avail, *((u16_t *)argp)); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, FIONREAD, %p) = %u\n", s, argp, *((u16_t *)argp))); sock_set_errno(sock, 0); diff --git a/modules/network/SMSTCPIP/tcp.c b/modules/network/SMSTCPIP/tcp.c index 8c82714e5..b3fd31cc5 100644 --- a/modules/network/SMSTCPIP/tcp.c +++ b/modules/network/SMSTCPIP/tcp.c @@ -460,7 +460,7 @@ tcp_new_port(void) struct tcp_pcb *pcb; #ifndef TCP_LOCAL_PORT_RANGE_START #define TCP_LOCAL_PORT_RANGE_START 4096 -#define TCP_LOCAL_PORT_RANGE_END 0x7fff +#define TCP_LOCAL_PORT_RANGE_END 0x7fff #endif static u16_t port = TCP_LOCAL_PORT_RANGE_START; // randomize the port value a bit to avoid TCP conflicts diff --git a/modules/network/SMSTCPIP/tcpip.c b/modules/network/SMSTCPIP/tcpip.c index 6d244e9f8..688abb1f5 100644 --- a/modules/network/SMSTCPIP/tcpip.c +++ b/modules/network/SMSTCPIP/tcpip.c @@ -112,7 +112,7 @@ err_t tcpip_input(struct pbuf *p, struct netif *inp) ret = ip_input(p, inp); UNLOCK_TCPIP_CORE(); return ret; -#else /* LWIP_TCPIP_CORE_LOCKING_INPUT */ +#else /* LWIP_TCPIP_CORE_LOCKING_INPUT */ struct tcpip_msg *msg = memp_malloc(MEMP_TCPIP_MSG); if (msg) { @@ -141,7 +141,7 @@ void tcpip_apimsg(struct api_msg *apimsg) LOCK_TCPIP_CORE(); api_msg_input(apimsg); UNLOCK_TCPIP_CORE(); -#else /* LWIP_TCPIP_CORE_LOCKING */ +#else /* LWIP_TCPIP_CORE_LOCKING */ struct tcpip_msg *msg = memp_malloc(MEMP_TCPIP_MSG); if (msg) { @@ -150,7 +150,6 @@ void tcpip_apimsg(struct api_msg *apimsg) msg->msg.apimsg = apimsg; sys_mbox_post(g_TCPIPMBox, msg); sys_mbox_fetch(apimsg->msg.conn->mbox, NULL); - } #endif /* LWIP_TCPIP_CORE_LOCKING */ diff --git a/modules/network/SMSTCPIP/timers.c b/modules/network/SMSTCPIP/timers.c index 5248eaf83..042996328 100644 --- a/modules/network/SMSTCPIP/timers.c +++ b/modules/network/SMSTCPIP/timers.c @@ -72,16 +72,16 @@ static int tcpip_tcp_timer_active; static void tcpip_tcp_timer(void *arg) { - /* call TCP timer handler */ - tcp_tmr(); - /* timer still needed? */ - if (tcp_active_pcbs || tcp_tw_pcbs) { - /* restart timer */ - sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); - } else { - /* disable timer */ - tcpip_tcp_timer_active = 0; - } + /* call TCP timer handler */ + tcp_tmr(); + /* timer still needed? */ + if (tcp_active_pcbs || tcp_tw_pcbs) { + /* restart timer */ + sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); + } else { + /* disable timer */ + tcpip_tcp_timer_active = 0; + } } /** @@ -89,15 +89,14 @@ tcpip_tcp_timer(void *arg) * the reason is to have the TCP timer only running when * there are active (or time-wait) PCBs. */ -void -tcp_timer_needed(void) +void tcp_timer_needed(void) { - /* timer is off but needed again? */ - if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) { - /* enable and start timer */ - tcpip_tcp_timer_active = 1; - sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); - } + /* timer is off but needed again? */ + if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) { + /* enable and start timer */ + tcpip_tcp_timer_active = 1; + sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); + } } #endif /* LWIP_TCP */ @@ -110,10 +109,10 @@ tcp_timer_needed(void) static void arp_timer(void *arg) { - LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n")); - etharp_tmr(); - sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); + LWIP_UNUSED_ARG(arg); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n")); + etharp_tmr(); + sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); } #endif /* LWIP_ARP */ @@ -121,7 +120,7 @@ arp_timer(void *arg) void sys_timeouts_init(void) { #if LWIP_ARP - sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); + sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); #endif /* LWIP_ARP */ } @@ -136,52 +135,50 @@ void sys_timeouts_init(void) * @param arg argument to pass to the callback function */ #if LWIP_DEBUG_TIMERNAMES -void -sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name) -#else /* LWIP_DEBUG_TIMERNAMES */ -void -sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) +void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char *handler_name) +#else /* LWIP_DEBUG_TIMERNAMES */ +void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) #endif /* LWIP_DEBUG_TIMERNAMES */ { - struct sys_timeo *timeout, *t; + struct sys_timeo *timeout, *t; - timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT); - if (timeout == NULL) { - LWIP_ASSERT("sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout != NULL); - return; - } - timeout->next = NULL; - timeout->h = handler; - timeout->arg = arg; - timeout->time = msecs; + timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT); + if (timeout == NULL) { + LWIP_ASSERT("sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout != NULL); + return; + } + timeout->next = NULL; + timeout->h = handler; + timeout->arg = arg; + timeout->time = msecs; #if LWIP_DEBUG_TIMERNAMES - timeout->handler_name = handler_name; - LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n", - (void *)timeout, msecs, handler_name, (void *)arg)); + timeout->handler_name = handler_name; + LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%" U32_F " handler=%s arg=%p\n", + (void *)timeout, msecs, handler_name, (void *)arg)); #endif /* LWIP_DEBUG_TIMERNAMES */ - if (next_timeout == NULL) { - next_timeout = timeout; - return; - } + if (next_timeout == NULL) { + next_timeout = timeout; + return; + } - if (next_timeout->time > msecs) { - next_timeout->time -= msecs; - timeout->next = next_timeout; - next_timeout = timeout; - } else { - for(t = next_timeout; t != NULL; t = t->next) { - timeout->time -= t->time; - if (t->next == NULL || t->next->time > timeout->time) { - if (t->next != NULL) { - t->next->time -= timeout->time; + if (next_timeout->time > msecs) { + next_timeout->time -= msecs; + timeout->next = next_timeout; + next_timeout = timeout; + } else { + for (t = next_timeout; t != NULL; t = t->next) { + timeout->time -= t->time; + if (t->next == NULL || t->next->time > timeout->time) { + if (t->next != NULL) { + t->next->time -= timeout->time; + } + timeout->next = t->next; + t->next = timeout; + break; + } } - timeout->next = t->next; - t->next = timeout; - break; - } } - } } /** @@ -194,33 +191,32 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) * @param handler callback function that would be called by the timeout * @param arg callback argument that would be passed to handler */ -void -sys_untimeout(sys_timeout_handler handler, void *arg) +void sys_untimeout(sys_timeout_handler handler, void *arg) { - struct sys_timeo *prev_t, *t; + struct sys_timeo *prev_t, *t; - if (next_timeout == NULL) { - return; - } + if (next_timeout == NULL) { + return; + } - for (t = next_timeout, prev_t = NULL; t != NULL; prev_t = t, t = t->next) { - if ((t->h == handler) && (t->arg == arg)) { - /* We have a match */ - /* Unlink from previous in list */ - if (prev_t == NULL) { - next_timeout = t->next; - } else { - prev_t->next = t->next; - } - /* If not the last one, add time of this one back to next */ - if (t->next != NULL) { - t->next->time += t->time; - } - memp_free(MEMP_SYS_TIMEOUT, t); - return; + for (t = next_timeout, prev_t = NULL; t != NULL; prev_t = t, t = t->next) { + if ((t->h == handler) && (t->arg == arg)) { + /* We have a match */ + /* Unlink from previous in list */ + if (prev_t == NULL) { + next_timeout = t->next; + } else { + prev_t->next = t->next; + } + /* If not the last one, add time of this one back to next */ + if (t->next != NULL) { + t->next->time += t->time; + } + memp_free(MEMP_SYS_TIMEOUT, t); + return; + } } - } - return; + return; } @@ -231,66 +227,64 @@ sys_untimeout(sys_timeout_handler handler, void *arg) * @param mbox the mbox to fetch the message from * @param msg the place to store the message */ -void -sys_timeouts_mbox_fetch(sys_mbox_t mbox, void **msg) +void sys_timeouts_mbox_fetch(sys_mbox_t mbox, void **msg) { - u32_t time_needed; - struct sys_timeo *tmptimeout; - sys_timeout_handler handler; - void *arg; + u32_t time_needed; + struct sys_timeo *tmptimeout; + sys_timeout_handler handler; + void *arg; - again: - if (!next_timeout) { - time_needed = sys_arch_mbox_fetch(mbox, msg, 0); - } else { - if (next_timeout->time > 0) { - time_needed = sys_arch_mbox_fetch(mbox, msg, next_timeout->time); +again: + if (!next_timeout) { + time_needed = sys_arch_mbox_fetch(mbox, msg, 0); } else { - time_needed = SYS_ARCH_TIMEOUT; - } + if (next_timeout->time > 0) { + time_needed = sys_arch_mbox_fetch(mbox, msg, next_timeout->time); + } else { + time_needed = SYS_ARCH_TIMEOUT; + } - if (time_needed == SYS_ARCH_TIMEOUT) { - /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message + if (time_needed == SYS_ARCH_TIMEOUT) { + /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message could be fetched. We should now call the timeout handler and deallocate the memory allocated for the timeout. */ - tmptimeout = next_timeout; - next_timeout = tmptimeout->next; - handler = tmptimeout->h; - arg = tmptimeout->arg; + tmptimeout = next_timeout; + next_timeout = tmptimeout->next; + handler = tmptimeout->h; + arg = tmptimeout->arg; #if LWIP_DEBUG_TIMERNAMES - if (handler != NULL) { - LWIP_DEBUGF(TIMERS_DEBUG, ("stmf calling h=%s arg=%p\n", - tmptimeout->handler_name, arg)); - } + if (handler != NULL) { + LWIP_DEBUGF(TIMERS_DEBUG, ("stmf calling h=%s arg=%p\n", + tmptimeout->handler_name, arg)); + } #endif /* LWIP_DEBUG_TIMERNAMES */ - memp_free(MEMP_SYS_TIMEOUT, tmptimeout); - if (handler != NULL) { - /* For LWIP_TCPIP_CORE_LOCKING, lock the core before calling the + memp_free(MEMP_SYS_TIMEOUT, tmptimeout); + if (handler != NULL) { + /* For LWIP_TCPIP_CORE_LOCKING, lock the core before calling the timeout handler function. */ - LOCK_TCPIP_CORE(); - handler(arg); - UNLOCK_TCPIP_CORE(); - } + LOCK_TCPIP_CORE(); + handler(arg); + UNLOCK_TCPIP_CORE(); + } - /* We try again to fetch a message from the mbox. */ - goto again; - } else { - /* If time != SYS_ARCH_TIMEOUT, a message was received before the timeout + /* We try again to fetch a message from the mbox. */ + goto again; + } else { + /* If time != SYS_ARCH_TIMEOUT, a message was received before the timeout occured. The time variable is set to the number of milliseconds we waited for the message. */ - if (time_needed < next_timeout->time) { - next_timeout->time -= time_needed; - } else { - next_timeout->time = 0; - } + if (time_needed < next_timeout->time) { + next_timeout->time -= time_needed; + } else { + next_timeout->time = 0; + } + } } - } } -#else /* LWIP_TIMERS */ +#else /* LWIP_TIMERS */ /* Satisfy the TCP code which calls this function */ -void -tcp_timer_needed(void) +void tcp_timer_needed(void) { } #endif /* LWIP_TIMERS */ diff --git a/modules/network/SMSTCPIP/udp.c b/modules/network/SMSTCPIP/udp.c index a64c5608a..21c861b37 100644 --- a/modules/network/SMSTCPIP/udp.c +++ b/modules/network/SMSTCPIP/udp.c @@ -248,7 +248,7 @@ void udp_input(struct pbuf *p, struct netif *inp) } /* no fully matching pcb found? then look for an unconnected pcb */ if (pcb == NULL) { -/* Iterate through the UDP PCB list for a pcb that matches + /* Iterate through the UDP PCB list for a pcb that matches the local address. */ #ifdef SO_REUSE @@ -609,7 +609,7 @@ err_t udp_bind(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port) if (port == 0) { #ifndef UDP_LOCAL_PORT_RANGE_START #define UDP_LOCAL_PORT_RANGE_START 4096 -#define UDP_LOCAL_PORT_RANGE_END 0x7fff +#define UDP_LOCAL_PORT_RANGE_END 0x7fff #endif port = UDP_LOCAL_PORT_RANGE_START; ipcb = udp_pcbs; diff --git a/modules/network/common/httpclient.h b/modules/network/common/httpclient.h index 71897b51f..cefea4342 100644 --- a/modules/network/common/httpclient.h +++ b/modules/network/common/httpclient.h @@ -1,4 +1,4 @@ -#define HTTP_CMODE_CLOSED 0 +#define HTTP_CMODE_CLOSED 0 #define HTTP_CMODE_PERSISTENT 1 //EE-side only @@ -18,8 +18,8 @@ void HttpCloseConnection(s32 HttpSocket); int HttpSendGetRequest(s32 HttpSocket, const char *UserAgent, const char *host, s8 *mode, const u8 *mtime, const char *uri, char *output, u16 *out_len); #define HTTP_CLIENT_SERVER_NAME_MAX 30 -#define HTTP_CLIENT_USER_AGENT_MAX 16 -#define HTTP_CLIENT_URI_MAX 128 +#define HTTP_CLIENT_USER_AGENT_MAX 16 +#define HTTP_CLIENT_URI_MAX 128 enum HTTP_CLIENT_CMD { HTTP_CLIENT_CMD_CONN_ESTAB, @@ -61,9 +61,9 @@ struct HttpClientSendGetResult #ifdef _IOP #define httpc_IMPORTS_start DECLARE_IMPORT_TABLE(httpc, 1, 1) -#define httpc_IMPORTS_end END_IMPORT_TABLE +#define httpc_IMPORTS_end END_IMPORT_TABLE #define I_HttpEstabConnection DECLARE_IMPORT(4, HttpEstabConnection) #define I_HttpCloseConnection DECLARE_IMPORT(5, HttpCloseConnection) -#define I_HttpSendGetRequest DECLARE_IMPORT(6, HttpSendGetRequest) +#define I_HttpSendGetRequest DECLARE_IMPORT(6, HttpSendGetRequest) #endif diff --git a/modules/network/common/smstcpip-common.h b/modules/network/common/smstcpip-common.h index 8a9a8a746..f4d026f85 100644 --- a/modules/network/common/smstcpip-common.h +++ b/modules/network/common/smstcpip-common.h @@ -55,7 +55,7 @@ typedef signed char err_t; /* lwIP error type. */ /* From src/include/lwip/pbuf.h: */ #define PBUF_TRANSPORT_HLEN 20 -#define PBUF_IP_HLEN 20 +#define PBUF_IP_HLEN 20 typedef enum { PBUF_TRANSPORT, @@ -73,10 +73,10 @@ typedef enum { /* Definitions for the pbuf flag field (these are not the flags that are passed to pbuf_alloc()). */ -#define PBUF_FLAG_RAM 0x00 /* Flags that pbuf data is stored in RAM */ -#define PBUF_FLAG_ROM 0x01 /* Flags that pbuf data is stored in ROM */ +#define PBUF_FLAG_RAM 0x00 /* Flags that pbuf data is stored in RAM */ +#define PBUF_FLAG_ROM 0x01 /* Flags that pbuf data is stored in ROM */ #define PBUF_FLAG_POOL 0x02 /* Flags that the pbuf comes from the pbuf pool */ -#define PBUF_FLAG_REF 0x04 /* Flags thet the pbuf payload refers to RAM */ +#define PBUF_FLAG_REF 0x04 /* Flags thet the pbuf payload refers to RAM */ struct pbuf { @@ -116,7 +116,7 @@ struct ip_addr #define IP4_ADDR(ipaddr, a, b, c, d) (ipaddr)->addr = htonl(((u32)(a & 0xff) << 24) | ((u32)(b & 0xff) << 16) | \ ((u32)(c & 0xff) << 8) | (u32)(d & 0xff)) -#define ip_addr_set(dest, src) (dest)->addr = ((struct ip_addr *)src)->addr +#define ip_addr_set(dest, src) (dest)->addr = ((struct ip_addr *)src)->addr #define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \ (mask)->addr) == \ ((addr2)->addr & \ @@ -149,16 +149,16 @@ struct ip_addr /** whether the network interface is 'up'. this is * a software flag used to control whether this network * interface is enabled and processes traffic */ -#define NETIF_FLAG_UP 0x1U +#define NETIF_FLAG_UP 0x1U /** if set, the netif has broadcast capability */ -#define NETIF_FLAG_BROADCAST 0x2U +#define NETIF_FLAG_BROADCAST 0x2U /** if set, the netif is one end of a point-to-point connection */ #define NETIF_FLAG_POINTTOPOINT 0x4U /** if set, the interface is configured using DHCP */ -#define NETIF_FLAG_DHCP 0x08U +#define NETIF_FLAG_DHCP 0x08U /** if set, the interface has an active link * (set by the interface) */ -#define NETIF_FLAG_LINK_UP 0x10U +#define NETIF_FLAG_LINK_UP 0x10U /** generic data structure used for all lwIP network interfaces */ struct netif @@ -234,35 +234,35 @@ struct sockaddr #endif #define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 /* * Option flags per-socket. */ -#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ +#define SO_DEBUG 0x0001 /* turn on debugging info recording */ +#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ +#define SO_REUSEADDR 0x0004 /* allow local address reuse */ +#define SO_KEEPALIVE 0x0008 /* keep connections alive */ +#define SO_DONTROUTE 0x0010 /* just use interface addresses */ +#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ #define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ +#define SO_LINGER 0x0080 /* linger on close if data present */ +#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ #define SO_DONTLINGER (int)(~SO_LINGER) /* * Additional options, not kept in so_options. */ -#define SO_SNDBUF 0x1001 /* send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDBUF 0x1001 /* send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ #define SO_SNDLOWAT 0x1003 /* send low-water mark */ #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ #define SO_SNDTIMEO 0x1005 /* send timeout */ #define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ /* * Level number for (get/set)sockopt() to apply to socket itself. @@ -270,13 +270,13 @@ struct sockaddr #define SOL_SOCKET 0xfff /* options for socket level */ #define AF_UNSPEC 0 -#define AF_INET 2 -#define PF_INET AF_INET +#define AF_INET 2 +#define PF_INET AF_INET #define IPPROTO_TCP 6 #define IPPROTO_UDP 17 -#define INADDR_ANY 0 +#define INADDR_ANY 0 #define INADDR_BROADCAST 0xffffffff /* Flags we can use with send and recv. */ @@ -284,11 +284,11 @@ struct sockaddr #ifndef FD_SET #undef FD_SETSIZE -#define FD_SETSIZE 16 -#define FD_SET(n, p) ((p)->fd_bits[(n) / 8] |= (1 << ((n)&7))) -#define FD_CLR(n, p) ((p)->fd_bits[(n) / 8] &= ~(1 << ((n)&7))) +#define FD_SETSIZE 16 +#define FD_SET(n, p) ((p)->fd_bits[(n) / 8] |= (1 << ((n)&7))) +#define FD_CLR(n, p) ((p)->fd_bits[(n) / 8] &= ~(1 << ((n)&7))) #define FD_ISSET(n, p) ((p)->fd_bits[(n) / 8] & (1 << ((n)&7))) -#define FD_ZERO(p) memset((void *)(p), 0, sizeof(*(p))) +#define FD_ZERO(p) memset((void *)(p), 0, sizeof(*(p))) typedef struct fd_set { @@ -328,14 +328,14 @@ typedef struct fd_set */ #if !defined(FIONREAD) || !defined(FIONBIO) -#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000 /* no parameters */ -#define IOC_OUT 0x40000000 /* copy out parameters */ -#define IOC_IN 0x80000000 /* copy in parameters */ -#define IOC_INOUT (IOC_IN | IOC_OUT) +#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ +#define IOC_VOID 0x20000000 /* no parameters */ +#define IOC_OUT 0x40000000 /* copy out parameters */ +#define IOC_IN 0x80000000 /* copy in parameters */ +#define IOC_INOUT (IOC_IN | IOC_OUT) /* 0x20000000 distinguishes new & old ioctl's */ -#define _IO(x, y) (IOC_VOID | ((x) << 8) | (y)) +#define _IO(x, y) (IOC_VOID | ((x) << 8) | (y)) #define _IOR(x, y, t) (IOC_OUT | (((long)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y)) @@ -383,7 +383,7 @@ struct hostent /* * User-settable options (used with setsockopt, IPPROTO_TCP level). */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ #define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keepalive miliseconds */ #endif diff --git a/modules/network/common/smstcpip.h b/modules/network/common/smstcpip.h index fadee6071..8c4814138 100644 --- a/modules/network/common/smstcpip.h +++ b/modules/network/common/smstcpip.h @@ -20,7 +20,7 @@ #include "smstcpip-common.h" #define ps2ip_IMPORTS_start DECLARE_IMPORT_TABLE(ps2ip, 1, 4) -#define ps2ip_IMPORTS_end END_IMPORT_TABLE +#define ps2ip_IMPORTS_end END_IMPORT_TABLE struct pbuf *pbuf_alloc(pbuf_layer l, u16 size, pbuf_flag flag); #define I_pbuf_alloc DECLARE_IMPORT(33, pbuf_alloc) @@ -125,17 +125,17 @@ char *inet_ntoa(struct in_addr addr); /* returns ptr to static buffer; not reent /* Compatibility macros. */ -#define accept lwip_accept -#define bind lwip_bind -#define disconnect lwip_close -#define connect lwip_connect -#define listen lwip_listen -#define recv lwip_recv -#define recvfrom lwip_recvfrom -#define send lwip_send -#define sendto lwip_sendto -#define socket lwip_socket -#define select lwip_select +#define accept lwip_accept +#define bind lwip_bind +#define disconnect lwip_close +#define connect lwip_connect +#define listen lwip_listen +#define recv lwip_recv +#define recvfrom lwip_recvfrom +#define send lwip_send +#define sendto lwip_sendto +#define socket lwip_socket +#define select lwip_select #define ioctlsocket lwip_ioctl int ps2ip_setconfig(t_ip_info *ip_info); @@ -148,7 +148,7 @@ err_t ps2ip_input(struct pbuf *pBuf, struct netif *pNetIF); // ntba2 #define getsockname lwip_getsockname #define getpeername lwip_getpeername -#define getsockopt lwip_getsockopt -#define setsockopt lwip_setsockopt +#define getsockopt lwip_getsockopt +#define setsockopt lwip_setsockopt #endif /* IOP_PS2IP_H */ diff --git a/modules/network/lwnbdsvr/lwNBD/README.md b/modules/network/lwnbdsvr/lwNBD/README.md index 73d12305b..c883271f6 100644 --- a/modules/network/lwnbdsvr/lwNBD/README.md +++ b/modules/network/lwnbdsvr/lwNBD/README.md @@ -18,4 +18,4 @@ Although this server is not yet complete in respect of the minimal requirements #TODO: * fix NBD_FLAG_FIXED_NEWSTYLE negotiation -* NBD_OPT_INFO/NBD_OPT_GO, the server is not yet able to serve many export. Currently, the server takes the first on the list. \ No newline at end of file +* NBD_OPT_INFO/NBD_OPT_GO, the server is not yet able to serve many export. Currently, the server takes the first on the list. diff --git a/modules/network/lwnbdsvr/lwNBD/nbd-protocol.h b/modules/network/lwnbdsvr/lwNBD/nbd-protocol.h index 628bc3b87..050d6202d 100644 --- a/modules/network/lwnbdsvr/lwNBD/nbd-protocol.h +++ b/modules/network/lwnbdsvr/lwNBD/nbd-protocol.h @@ -59,7 +59,7 @@ struct nbd_old_handshake char zeroes[124]; /* must be sent as zero bytes */ } NBD_ATTRIBUTE_PACKED; -#define NBD_MAGIC UINT64_C(0x4e42444d41474943) /* ASCII "NBDMAGIC" */ +#define NBD_MAGIC UINT64_C(0x4e42444d41474943) /* ASCII "NBDMAGIC" */ #define NBD_OLD_VERSION UINT64_C(0x0000420281861253) /* New-style handshake. */ @@ -104,53 +104,53 @@ struct nbd_fixed_new_option_reply /* Global flags. */ #define NBD_FLAG_FIXED_NEWSTYLE (1 << 0) -#define NBD_FLAG_NO_ZEROES (1 << 1) +#define NBD_FLAG_NO_ZEROES (1 << 1) /* Per-export flags. */ -#define NBD_FLAG_HAS_FLAGS (1 << 0) -#define NBD_FLAG_READ_ONLY (1 << 1) -#define NBD_FLAG_SEND_FLUSH (1 << 2) -#define NBD_FLAG_SEND_FUA (1 << 3) -#define NBD_FLAG_ROTATIONAL (1 << 4) -#define NBD_FLAG_SEND_TRIM (1 << 5) +#define NBD_FLAG_HAS_FLAGS (1 << 0) +#define NBD_FLAG_READ_ONLY (1 << 1) +#define NBD_FLAG_SEND_FLUSH (1 << 2) +#define NBD_FLAG_SEND_FUA (1 << 3) +#define NBD_FLAG_ROTATIONAL (1 << 4) +#define NBD_FLAG_SEND_TRIM (1 << 5) #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) -#define NBD_FLAG_SEND_DF (1 << 7) -#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) -#define NBD_FLAG_SEND_CACHE (1 << 10) -#define NBD_FLAG_SEND_FAST_ZERO (1 << 11) +#define NBD_FLAG_SEND_DF (1 << 7) +#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) +#define NBD_FLAG_SEND_CACHE (1 << 10) +#define NBD_FLAG_SEND_FAST_ZERO (1 << 11) /* NBD options (new style handshake only). */ -#define NBD_OPT_EXPORT_NAME 1 -#define NBD_OPT_ABORT 2 -#define NBD_OPT_LIST 3 -#define NBD_OPT_STARTTLS 5 -#define NBD_OPT_INFO 6 -#define NBD_OPT_GO 7 -#define NBD_OPT_STRUCTURED_REPLY 8 +#define NBD_OPT_EXPORT_NAME 1 +#define NBD_OPT_ABORT 2 +#define NBD_OPT_LIST 3 +#define NBD_OPT_STARTTLS 5 +#define NBD_OPT_INFO 6 +#define NBD_OPT_GO 7 +#define NBD_OPT_STRUCTURED_REPLY 8 #define NBD_OPT_LIST_META_CONTEXT 9 -#define NBD_OPT_SET_META_CONTEXT 10 +#define NBD_OPT_SET_META_CONTEXT 10 -#define NBD_REP_ERR(val) (0x80000000 | (val)) +#define NBD_REP_ERR(val) (0x80000000 | (val)) #define NBD_REP_IS_ERR(val) (!!((val)&0x80000000)) -#define NBD_REP_ACK 1 -#define NBD_REP_SERVER 2 -#define NBD_REP_INFO 3 -#define NBD_REP_META_CONTEXT 4 -#define NBD_REP_ERR_UNSUP NBD_REP_ERR(1) -#define NBD_REP_ERR_POLICY NBD_REP_ERR(2) -#define NBD_REP_ERR_INVALID NBD_REP_ERR(3) -#define NBD_REP_ERR_PLATFORM NBD_REP_ERR(4) -#define NBD_REP_ERR_TLS_REQD NBD_REP_ERR(5) -#define NBD_REP_ERR_UNKNOWN NBD_REP_ERR(6) -#define NBD_REP_ERR_SHUTDOWN NBD_REP_ERR(7) +#define NBD_REP_ACK 1 +#define NBD_REP_SERVER 2 +#define NBD_REP_INFO 3 +#define NBD_REP_META_CONTEXT 4 +#define NBD_REP_ERR_UNSUP NBD_REP_ERR(1) +#define NBD_REP_ERR_POLICY NBD_REP_ERR(2) +#define NBD_REP_ERR_INVALID NBD_REP_ERR(3) +#define NBD_REP_ERR_PLATFORM NBD_REP_ERR(4) +#define NBD_REP_ERR_TLS_REQD NBD_REP_ERR(5) +#define NBD_REP_ERR_UNKNOWN NBD_REP_ERR(6) +#define NBD_REP_ERR_SHUTDOWN NBD_REP_ERR(7) #define NBD_REP_ERR_BLOCK_SIZE_REQD NBD_REP_ERR(8) -#define NBD_REP_ERR_TOO_BIG NBD_REP_ERR(9) +#define NBD_REP_ERR_TOO_BIG NBD_REP_ERR(9) -#define NBD_INFO_EXPORT 0 -#define NBD_INFO_NAME 1 +#define NBD_INFO_EXPORT 0 +#define NBD_INFO_NAME 1 #define NBD_INFO_DESCRIPTION 2 -#define NBD_INFO_BLOCK_SIZE 3 +#define NBD_INFO_BLOCK_SIZE 3 /* NBD_INFO_EXPORT reply (follows fixed_new_option_reply). */ struct nbd_fixed_new_option_reply_info_export @@ -247,49 +247,49 @@ struct nbd_structured_reply_error /* Followed by human readable error string, and possibly more structure. */ } NBD_ATTRIBUTE_PACKED; -#define NBD_REQUEST_MAGIC 0x25609513 -#define NBD_SIMPLE_REPLY_MAGIC 0x67446698 +#define NBD_REQUEST_MAGIC 0x25609513 +#define NBD_SIMPLE_REPLY_MAGIC 0x67446698 #define NBD_STRUCTURED_REPLY_MAGIC 0x668e33ef /* Structured reply flags. */ #define NBD_REPLY_FLAG_DONE (1 << 0) -#define NBD_REPLY_TYPE_ERR(val) ((1 << 15) | (val)) +#define NBD_REPLY_TYPE_ERR(val) ((1 << 15) | (val)) #define NBD_REPLY_TYPE_IS_ERR(val) (!!((val) & (1 << 15))) /* Structured reply types. */ -#define NBD_REPLY_TYPE_NONE 0 -#define NBD_REPLY_TYPE_OFFSET_DATA 1 -#define NBD_REPLY_TYPE_OFFSET_HOLE 2 +#define NBD_REPLY_TYPE_NONE 0 +#define NBD_REPLY_TYPE_OFFSET_DATA 1 +#define NBD_REPLY_TYPE_OFFSET_HOLE 2 #define NBD_REPLY_TYPE_BLOCK_STATUS 5 -#define NBD_REPLY_TYPE_ERROR NBD_REPLY_TYPE_ERR(1) +#define NBD_REPLY_TYPE_ERROR NBD_REPLY_TYPE_ERR(1) #define NBD_REPLY_TYPE_ERROR_OFFSET NBD_REPLY_TYPE_ERR(2) /* NBD commands. */ -#define NBD_CMD_READ 0 -#define NBD_CMD_WRITE 1 -#define NBD_CMD_DISC 2 /* Disconnect. */ -#define NBD_CMD_FLUSH 3 -#define NBD_CMD_TRIM 4 -#define NBD_CMD_CACHE 5 +#define NBD_CMD_READ 0 +#define NBD_CMD_WRITE 1 +#define NBD_CMD_DISC 2 /* Disconnect. */ +#define NBD_CMD_FLUSH 3 +#define NBD_CMD_TRIM 4 +#define NBD_CMD_CACHE 5 #define NBD_CMD_WRITE_ZEROES 6 #define NBD_CMD_BLOCK_STATUS 7 -#define NBD_CMD_FLAG_FUA (1 << 0) -#define NBD_CMD_FLAG_NO_HOLE (1 << 1) -#define NBD_CMD_FLAG_DF (1 << 2) -#define NBD_CMD_FLAG_REQ_ONE (1 << 3) +#define NBD_CMD_FLAG_FUA (1 << 0) +#define NBD_CMD_FLAG_NO_HOLE (1 << 1) +#define NBD_CMD_FLAG_DF (1 << 2) +#define NBD_CMD_FLAG_REQ_ONE (1 << 3) #define NBD_CMD_FLAG_FAST_ZERO (1 << 4) /* NBD error codes. */ -#define NBD_SUCCESS 0 -#define NBD_EPERM 1 -#define NBD_EIO 5 -#define NBD_ENOMEM 12 -#define NBD_EINVAL 22 -#define NBD_ENOSPC 28 +#define NBD_SUCCESS 0 +#define NBD_EPERM 1 +#define NBD_EIO 5 +#define NBD_ENOMEM 12 +#define NBD_EINVAL 22 +#define NBD_ENOSPC 28 #define NBD_EOVERFLOW 75 -#define NBD_ENOTSUP 95 +#define NBD_ENOTSUP 95 #define NBD_ESHUTDOWN 108 #endif /* NBD_PROTOCOL_H */ diff --git a/modules/network/lwnbdsvr/lwNBD/nbd_server.h b/modules/network/lwnbdsvr/lwNBD/nbd_server.h index 6c19c41b6..75ee6ddf8 100644 --- a/modules/network/lwnbdsvr/lwNBD/nbd_server.h +++ b/modules/network/lwnbdsvr/lwNBD/nbd_server.h @@ -75,7 +75,7 @@ static inline uint64_t bswap64(uint64_t x) //TODO: Missing in PS2SK's , needed for "nbd-protocol.h" // https://en.cppreference.com/w/c/types/integer -#define UINT64_MAX 0xffffffffffffffff +#define UINT64_MAX 0xffffffffffffffff #define UINT64_C(x) ((x) + (UINT64_MAX - UINT64_MAX)) #endif diff --git a/modules/network/nbns/nbns.c b/modules/network/nbns/nbns.c index a23b193f7..78f342237 100644 --- a/modules/network/nbns/nbns.c +++ b/modules/network/nbns/nbns.c @@ -17,14 +17,14 @@ #define BSWAP16(x) (((x) << 8 & 0xFF00) | ((x) >> 8 & 0xFF)) -#define NB_OPCODE(R, OPCODE) (((R) << 4) | (OPCODE)) +#define NB_OPCODE(R, OPCODE) (((R) << 4) | (OPCODE)) #define NB_MN_FLAGS(AA, TC, RD, RA, B) (((AA) << 6) | ((TC) << 5) | ((RD) << 4) | ((RA) << 3) | (B)) -#define NB_CODE(OPCODE, FLAGS, RCODE) (((OPCODE) << 11) | ((FLAGS) << 4) | (RCODE)) +#define NB_CODE(OPCODE, FLAGS, RCODE) (((OPCODE) << 11) | ((FLAGS) << 4) | (RCODE)) -#define NB_GET_RCODE(CODE) ((CODE)&0xF) +#define NB_GET_RCODE(CODE) ((CODE)&0xF) #define NB_GET_MN_FLAGS(CODE) (((CODE) >> 4) & 0x7F) -#define NB_GET_OPCODE(CODE) (((CODE) >> 11) & 0xF) -#define NB_GET_R(CODE) (((CODE) >> 15) & 1) +#define NB_GET_OPCODE(CODE) (((CODE) >> 11) & 0xF) +#define NB_GET_R(CODE) (((CODE) >> 15) & 1) enum NB_OPCODE_TYPE { NB_OPCODE_TYPE_QUERY = 0, @@ -36,7 +36,7 @@ enum NB_OPCODE_TYPE { NB_OPCODE_TYPE_COUNT }; -#define QUESTION_TYPE_NB 0x0020 //NetBIOS general Name Service Resource Record +#define QUESTION_TYPE_NB 0x0020 //NetBIOS general Name Service Resource Record #define QUESTION_CLASS_IN 0x0001 //Internet class struct NbHeader @@ -57,8 +57,8 @@ struct NbQuestionTrailer //Record status bits. #define NBNS_NAME_RECORD_ALLOCATED 0x01 -#define NBNS_NAME_RECORD_INIT 0x02 -#define NBNS_NAME_RECORD_VALID 0x04 +#define NBNS_NAME_RECORD_INIT 0x02 +#define NBNS_NAME_RECORD_VALID 0x04 struct NBNSNameRecord { diff --git a/modules/network/smap-ingame/main.c b/modules/network/smap-ingame/main.c index 54ee0f34b..008bf7962 100644 --- a/modules/network/smap-ingame/main.c +++ b/modules/network/smap-ingame/main.c @@ -32,9 +32,9 @@ static NetIF NIF; //From lwip/err.h and lwip/tcpip.h -#define ERR_OK 0 //No error, everything OK -#define ERR_CONN -6 //Not connected -#define ERR_IF -11 //Low-level netif error +#define ERR_OK 0 //No error, everything OK +#define ERR_CONN -6 //Not connected +#define ERR_IF -11 //Low-level netif error //SMapLowLevelOutput(): diff --git a/modules/network/smap-ingame/smap.c b/modules/network/smap-ingame/smap.c index a82d90bd7..caddd70cf 100644 --- a/modules/network/smap-ingame/smap.c +++ b/modules/network/smap-ingame/smap.c @@ -47,9 +47,9 @@ #define DEV9_SMAP_ALL_INTR_MASK (SMAP_INTR_EMAC3 | SMAP_INTR_RXEND | SMAP_INTR_TXEND | SMAP_INTR_RXDNV | SMAP_INTR_TXDNV) //Unlike the SONY original, the RXDNV interrupt is not handled as statistics are not recorded. //For the sake of simplicity, Tx channel 0 is operated in single-mode. Do not handle TXDNV. -#define DEV9_SMAP_INTR_MASK (SMAP_INTR_EMAC3 | SMAP_INTR_RXEND) +#define DEV9_SMAP_INTR_MASK (SMAP_INTR_EMAC3 | SMAP_INTR_RXEND) //The Tx interrupt events are handled separately -#define DEV9_SMAP_INTR_MASK2 (SMAP_INTR_EMAC3 | SMAP_INTR_RXEND) +#define DEV9_SMAP_INTR_MASK2 (SMAP_INTR_EMAC3 | SMAP_INTR_RXEND) struct SmapDriverData SmapDriverData; diff --git a/modules/network/smbinit/des.c b/modules/network/smbinit/des.c index 3458cab1b..802a4a233 100644 --- a/modules/network/smbinit/des.c +++ b/modules/network/smbinit/des.c @@ -59,7 +59,7 @@ *((c)++) = (unsigned char)(((l) >> 16) & 0xff), \ *((c)++) = (unsigned char)(((l) >> 24) & 0xff)) -#define ITERATIONS 16 +#define ITERATIONS 16 #define HPERM_OP(a, t, n, m) ((t) = ((((a) << (16 - (n))) ^ (a)) & (m)), \ (a) = (a) ^ (t) ^ (t >> (16 - (n)))) diff --git a/modules/pademu/ds34bt.c b/modules/pademu/ds34bt.c index d77ba2ff8..409f823cf 100644 --- a/modules/pademu/ds34bt.c +++ b/modules/pademu/ds34bt.c @@ -335,10 +335,10 @@ static u8 GenuineMacAddress[][3] = //fake with AirohaTechnologyCorp's Chip {0x0C, 0xFC, 0x83}}; -#define REQ_HCI_OUT (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE) +#define REQ_HCI_OUT (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE) #define HCI_COMMAND_REQ 0 -#define MAX_PADS 4 +#define MAX_PADS 4 #define MAX_DELAY 10 static u8 hci_buf[MAX_BUFFER_SIZE] __attribute((aligned(4))) = {0}; diff --git a/modules/pademu/ds34bt.h b/modules/pademu/ds34bt.h index 1c270a689..949da0ebc 100644 --- a/modules/pademu/ds34bt.h +++ b/modules/pademu/ds34bt.h @@ -4,12 +4,12 @@ #include "irx.h" #define USB_CLASS_WIRELESS_CONTROLLER 0xE0 -#define USB_SUBCLASS_RF_CONTROLLER 0x01 -#define USB_PROTOCOL_BLUETOOTH_PROG 0x01 +#define USB_SUBCLASS_RF_CONTROLLER 0x01 +#define USB_PROTOCOL_BLUETOOTH_PROG 0x01 -#define DS34_VID 0x054C // Sony Corporation -#define DS3_PID 0x0268 // PS3 Controller -#define DS4_PID 0x05C4 // PS4 Controller +#define DS34_VID 0x054C // Sony Corporation +#define DS3_PID 0x0268 // PS3 Controller +#define DS4_PID 0x05C4 // PS4 Controller #define DS4_PID_SLIM 0x09CC // PS4 Slim Controller #define DS3 0 @@ -17,7 +17,7 @@ #define MAX_BUFFER_SIZE 64 // Size of general purpose data buffer -#define PENDING 1 +#define PENDING 1 #define SUCCESSFUL 0 typedef struct @@ -61,11 +61,11 @@ enum eDS34BTStatus { }; #define pad_status_clear(flag, pad) ds34pad[pad].status &= ~flag -#define pad_status_set(flag, pad) ds34pad[pad].status |= flag +#define pad_status_set(flag, pad) ds34pad[pad].status |= flag #define pad_status_check(flag, pad) (ds34pad[pad].status & flag) #define hci_event_flag_clear(flag) hci_event_flag &= ~flag -#define hci_event_flag_set(flag) hci_event_flag |= flag +#define hci_event_flag_set(flag) hci_event_flag |= flag #define hci_event_flag_check(flag) (hci_event_flag & flag) enum eHCI { @@ -201,9 +201,9 @@ enum eL2CAP { }; #define l2cap_handle_ok(handle) (((u16)(l2cap_buf[0] | (l2cap_buf[1] << 8)) & 0x0FFF) == (u16)(handle & 0x0FFF)) -#define l2cap_control_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == 0x0001) // Channel ID for ACL-U +#define l2cap_control_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == 0x0001) // Channel ID for ACL-U #define l2cap_interrupt_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == interrupt_dcid) -#define l2cap_command_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == control_dcid) +#define l2cap_command_channel ((l2cap_buf[6] | (l2cap_buf[7] << 8)) == control_dcid) enum eHID { // {{{ @@ -241,13 +241,13 @@ struct ds3report struct { u8 Select : 1; - u8 L3 : 1; - u8 R3 : 1; - u8 Start : 1; - u8 Up : 1; - u8 Right : 1; - u8 Down : 1; - u8 Left : 1; + u8 L3 : 1; + u8 R3 : 1; + u8 Start : 1; + u8 Up : 1; + u8 Right : 1; + u8 Down : 1; + u8 Left : 1; }; }; union @@ -255,14 +255,14 @@ struct ds3report u8 ButtonStateH; // Main buttons High struct { - u8 L2 : 1; - u8 R2 : 1; - u8 L1 : 1; - u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 L1 : 1; + u8 R1 : 1; u8 Triangle : 1; - u8 Circle : 1; - u8 Cross : 1; - u8 Square : 1; + u8 Circle : 1; + u8 Cross : 1; + u8 Square : 1; }; }; u8 PSButtonState; // PS button @@ -299,25 +299,25 @@ struct ds3report struct ds4report { u8 ReportID; - u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid - u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid - u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid - u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid - u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW - u8 Square : 1; - u8 Cross : 1; - u8 Circle : 1; + u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid + u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid + u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid + u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid + u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW + u8 Square : 1; + u8 Cross : 1; + u8 Circle : 1; u8 Triangle : 1; - u8 L1 : 1; - u8 R1 : 1; - u8 L2 : 1; - u8 R2 : 1; - u8 Share : 1; - u8 Option : 1; - u8 L3 : 1; - u8 R3 : 1; + u8 L1 : 1; + u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 Share : 1; + u8 Option : 1; + u8 L3 : 1; + u8 R3 : 1; u8 PSButton : 1; - u8 TPad : 1; + u8 TPad : 1; u8 Counter1 : 6; // counts up by 1 per report u8 PressureL2; // digital Pad L2 button Pressure 0 - 255 u8 PressureR2; // digital Pad R2 button Pressure 0 - 255 @@ -330,23 +330,23 @@ struct ds4report s16 GyroZ; s16 GyroY; s16 GyroX; - u8 Reserved1[5]; // Unknown - u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged + u8 Reserved1[5]; // Unknown + u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged u8 Usb_plugged : 1; - u8 Headphones : 1; - u8 Microphone : 1; - u8 Padding : 1; - u8 Reserved2[2]; // Unknown - u8 TPpack; // number of trackpad packets (0x00 to 0x04) - u8 PackCounter; // packet counter - u8 Finger1ID : 7; // counter - u8 Finger1Active : 1; // 0 - active, 1 - unactive - u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 - u16 Finger1Y : 12; - u8 Finger2ID : 7; + u8 Headphones : 1; + u8 Microphone : 1; + u8 Padding : 1; + u8 Reserved2[2]; // Unknown + u8 TPpack; // number of trackpad packets (0x00 to 0x04) + u8 PackCounter; // packet counter + u8 Finger1ID : 7; // counter + u8 Finger1Active : 1; // 0 - active, 1 - unactive + u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 + u16 Finger1Y : 12; + u8 Finger2ID : 7; u8 Finger2Active : 1; - u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 - u16 Finger2Y : 12; + u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 + u16 Finger2Y : 12; } __attribute__((packed)); diff --git a/modules/pademu/ds34usb.c b/modules/pademu/ds34usb.c index c2fafc1a1..b1cf74aa3 100644 --- a/modules/pademu/ds34usb.c +++ b/modules/pademu/ds34usb.c @@ -14,7 +14,7 @@ #define DPRINTF(x...) #define REQ_USB_OUT (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) -#define REQ_USB_IN (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) +#define REQ_USB_IN (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) #define MAX_PADS 4 diff --git a/modules/pademu/ds34usb.h b/modules/pademu/ds34usb.h index 2ab3532c5..595b84300 100644 --- a/modules/pademu/ds34usb.h +++ b/modules/pademu/ds34usb.h @@ -3,9 +3,9 @@ #include "irx.h" -#define DS34_VID 0x054C // Sony Corporation -#define DS3_PID 0x0268 // PS3 Controller -#define DS4_PID 0x05C4 // PS4 Controller +#define DS34_VID 0x054C // Sony Corporation +#define DS3_PID 0x0268 // PS3 Controller +#define DS4_PID 0x05C4 // PS4 Controller #define DS4_PID_SLIM 0x09CC // PS4 Slim Controller #define DS3 0 @@ -75,13 +75,13 @@ struct ds3report struct { u8 Select : 1; - u8 L3 : 1; - u8 R3 : 1; - u8 Start : 1; - u8 Up : 1; - u8 Right : 1; - u8 Down : 1; - u8 Left : 1; + u8 L3 : 1; + u8 R3 : 1; + u8 Start : 1; + u8 Up : 1; + u8 Right : 1; + u8 Down : 1; + u8 Left : 1; }; }; union @@ -89,14 +89,14 @@ struct ds3report u8 ButtonStateH; // Main buttons High struct { - u8 L2 : 1; - u8 R2 : 1; - u8 L1 : 1; - u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 L1 : 1; + u8 R1 : 1; u8 Triangle : 1; - u8 Circle : 1; - u8 Cross : 1; - u8 Square : 1; + u8 Circle : 1; + u8 Cross : 1; + u8 Square : 1; }; }; u8 PSButtonState; // PS button @@ -133,25 +133,25 @@ struct ds3report struct ds4report { u8 ReportID; - u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid - u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid - u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid - u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid - u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW - u8 Square : 1; - u8 Cross : 1; - u8 Circle : 1; + u8 LeftStickX; // left Joystick X axis 0 - 255, 128 is mid + u8 LeftStickY; // left Joystick Y axis 0 - 255, 128 is mid + u8 RightStickX; // right Joystick X axis 0 - 255, 128 is mid + u8 RightStickY; // right Joystick Y axis 0 - 255, 128 is mid + u8 Dpad : 4; // hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW + u8 Square : 1; + u8 Cross : 1; + u8 Circle : 1; u8 Triangle : 1; - u8 L1 : 1; - u8 R1 : 1; - u8 L2 : 1; - u8 R2 : 1; - u8 Share : 1; - u8 Option : 1; - u8 L3 : 1; - u8 R3 : 1; + u8 L1 : 1; + u8 R1 : 1; + u8 L2 : 1; + u8 R2 : 1; + u8 Share : 1; + u8 Option : 1; + u8 L3 : 1; + u8 R3 : 1; u8 PSButton : 1; - u8 TPad : 1; + u8 TPad : 1; u8 Counter1 : 6; // counts up by 1 per report u8 PressureL2; // digital Pad L2 button Pressure 0 - 255 u8 PressureR2; // digital Pad R2 button Pressure 0 - 255 @@ -164,23 +164,23 @@ struct ds4report s16 GyroZ; s16 GyroY; s16 GyroX; - u8 Reserved1[5]; // Unknown - u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged + u8 Reserved1[5]; // Unknown + u8 Power : 4; // from 0x0 to 0xA - charging, 0xB - charged u8 Usb_plugged : 1; - u8 Headphones : 1; - u8 Microphone : 1; - u8 Padding : 1; - u8 Reserved2[2]; // Unknown - u8 TPpack; // number of trackpad packets (0x00 to 0x04) - u8 PackCounter; // packet counter - u8 Finger1ID : 7; // counter - u8 Finger1Active : 1; // 0 - active, 1 - unactive - u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 - u16 Finger1Y : 12; - u8 Finger2ID : 7; + u8 Headphones : 1; + u8 Microphone : 1; + u8 Padding : 1; + u8 Reserved2[2]; // Unknown + u8 TPpack; // number of trackpad packets (0x00 to 0x04) + u8 PackCounter; // packet counter + u8 Finger1ID : 7; // counter + u8 Finger1Active : 1; // 0 - active, 1 - unactive + u16 Finger1X : 12; // finger 1 coordinates resolution 1920x943 + u16 Finger1Y : 12; + u8 Finger2ID : 7; u8 Finger2Active : 1; - u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 - u16 Finger2Y : 12; + u16 Finger2X : 12; // finger 2 coordinates resolution 1920x943 + u16 Finger2Y : 12; } __attribute__((packed)); diff --git a/modules/pademu/pademu.c b/modules/pademu/pademu.c index a0df86cab..cf36a0850 100644 --- a/modules/pademu/pademu.c +++ b/modules/pademu/pademu.c @@ -12,23 +12,23 @@ #include "ds34bt.h" -#define PAD_INIT ds34bt_init +#define PAD_INIT ds34bt_init #define PAD_GET_STATUS ds34bt_get_status -#define PAD_RESET ds34bt_reset -#define PAD_GET_DATA ds34bt_get_data +#define PAD_RESET ds34bt_reset +#define PAD_GET_DATA ds34bt_get_data #define PAD_SET_RUMBLE ds34bt_set_rumble -#define PAD_SET_MODE ds34bt_set_mode +#define PAD_SET_MODE ds34bt_set_mode #elif defined(USB) #include "ds34usb.h" -#define PAD_INIT ds34usb_init +#define PAD_INIT ds34usb_init #define PAD_GET_STATUS ds34usb_get_status -#define PAD_RESET ds34usb_reset -#define PAD_GET_DATA ds34usb_get_data +#define PAD_RESET ds34usb_reset +#define PAD_GET_DATA ds34usb_get_data #define PAD_SET_RUMBLE ds34usb_set_rumble -#define PAD_SET_MODE ds34usb_set_mode +#define PAD_SET_MODE ds34usb_set_mode #else #error "must define mode" @@ -52,9 +52,9 @@ typedef struct } pad_status_t; #define DIGITAL_MODE 0x41 -#define ANALOG_MODE 0x73 +#define ANALOG_MODE 0x73 #define ANALOGP_MODE 0x79 -#define CONFIG_MODE 0xF3 +#define CONFIG_MODE 0xF3 #define MAX_PORTS 4 diff --git a/modules/vmc/genvmc/genvmc.c b/modules/vmc/genvmc/genvmc.c index debea2d21..5f7327d1e 100644 --- a/modules/vmc/genvmc/genvmc.c +++ b/modules/vmc/genvmc/genvmc.c @@ -75,8 +75,8 @@ static iop_device_t genvmc_dev = { "genvmc", &genvmc_ops}; -#define sceMcDetectCard McDetectCard -#define sceMcReadPage McReadPage +#define sceMcDetectCard McDetectCard +#define sceMcReadPage McReadPage #define sceMcGetCardType McGetMcType // SONY superblock magic & version diff --git a/modules/vmc/genvmc/genvmc.h b/modules/vmc/genvmc/genvmc.h index 23c6f6ed0..656e40a91 100644 --- a/modules/vmc/genvmc/genvmc.h +++ b/modules/vmc/genvmc/genvmc.h @@ -9,11 +9,11 @@ // DEVCTL commands #define GENVMC_DEVCTL_CREATE_VMC 0xC0DE0001 -#define GENVMC_DEVCTL_ABORT 0xC0DE0002 -#define GENVMC_DEVCTL_STATUS 0xC0DE0003 +#define GENVMC_DEVCTL_ABORT 0xC0DE0002 +#define GENVMC_DEVCTL_STATUS 0xC0DE0003 #define GENVMC_STAT_AVAIL 0x00 -#define GENVMC_STAT_BUSY 0x01 +#define GENVMC_STAT_BUSY 0x01 // helpers for DEVCTL commands typedef struct diff --git a/pc/genvmc/Makefile b/pc/genvmc/Makefile index eb872dfe5..dc55cc66f 100644 --- a/pc/genvmc/Makefile +++ b/pc/genvmc/Makefile @@ -17,7 +17,7 @@ clean: rm -f src/*.o rebuild: clean all - + bin/genvmc: src/genvmc.o @mkdir -p bin $(CC) $(CFLAGS) src/genvmc.c -o bin/genvmc diff --git a/pc/genvmc/src/genvmc.c b/pc/genvmc/src/genvmc.c index d0752d76a..46454f1ac 100644 --- a/pc/genvmc/src/genvmc.c +++ b/pc/genvmc/src/genvmc.c @@ -8,26 +8,26 @@ #include "genvmc.h" // mc file attributes -#define SCE_STM_R 0x01 -#define SCE_STM_W 0x02 -#define SCE_STM_X 0x04 -#define SCE_STM_C 0x08 -#define SCE_STM_F 0x10 -#define SCE_STM_D 0x20 -#define sceMcFileAttrReadable SCE_STM_R -#define sceMcFileAttrWriteable SCE_STM_W -#define sceMcFileAttrExecutable SCE_STM_X +#define SCE_STM_R 0x01 +#define SCE_STM_W 0x02 +#define SCE_STM_X 0x04 +#define SCE_STM_C 0x08 +#define SCE_STM_F 0x10 +#define SCE_STM_D 0x20 +#define sceMcFileAttrReadable SCE_STM_R +#define sceMcFileAttrWriteable SCE_STM_W +#define sceMcFileAttrExecutable SCE_STM_X #define sceMcFileAttrDupProhibit SCE_STM_C -#define sceMcFileAttrFile SCE_STM_F -#define sceMcFileAttrSubdir SCE_STM_D -#define sceMcFileCreateDir 0x0040 -#define sceMcFileAttrClosed 0x0080 -#define sceMcFileCreateFile 0x0200 -#define sceMcFile0400 0x0400 -#define sceMcFileAttrPDAExec 0x0800 -#define sceMcFileAttrPS1 0x1000 -#define sceMcFileAttrHidden 0x2000 -#define sceMcFileAttrExists 0x8000 +#define sceMcFileAttrFile SCE_STM_F +#define sceMcFileAttrSubdir SCE_STM_D +#define sceMcFileCreateDir 0x0040 +#define sceMcFileAttrClosed 0x0080 +#define sceMcFileCreateFile 0x0200 +#define sceMcFile0400 0x0400 +#define sceMcFileAttrPDAExec 0x0800 +#define sceMcFileAttrPS1 0x1000 +#define sceMcFileAttrHidden 0x2000 +#define sceMcFileAttrExists 0x8000 // SONY superblock magic & version static char SUPERBLOCK_MAGIC[] = "Sony PS2 Memory Card Format "; diff --git a/pc/genvmc/src/genvmc.h b/pc/genvmc/src/genvmc.h index d6bddf5b7..16ad04618 100644 --- a/pc/genvmc/src/genvmc.h +++ b/pc/genvmc/src/genvmc.h @@ -19,9 +19,9 @@ #include #include -#define PROGRAM_NAME "genvmc" +#define PROGRAM_NAME "genvmc" #define PROGRAM_EXTNAME "VMC file generator for Open PS2 Loader" -#define PROGRAM_VER "0.1.0" +#define PROGRAM_VER "0.1.0" typedef unsigned char u8; typedef unsigned short u16; diff --git a/pc/iso2opl/libcvd_license.txt b/pc/iso2opl/libcvd_license.txt index bd0a0cb71..05a91b1af 100644 --- a/pc/iso2opl/libcvd_license.txt +++ b/pc/iso2opl/libcvd_license.txt @@ -1,17 +1,17 @@ Copyright (c) 2002, A.Lee & Nicholas Van Veen All rights reserved. - + Redistribution and use of this software, in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + 3. You are granted a license to use this software for academic, research and non-commercial purposes only. @@ -23,23 +23,23 @@ met: 5. Any licensee wishing to make commercial use of this software should contact the copyright holder to execute the appropriate license for such commercial use. Commercial use includes: - - - Integration of all or part of the source code into a product for sale + + - Integration of all or part of the source code into a product for sale or commercial license by or on behalf of Licensee to third parties, or - - Distribution of the binary code or source code to third parties that - need it to utilize a commercial product sold or licensed by or on + - Distribution of the binary code or source code to third parties that + need it to utilize a commercial product sold or licensed by or on behalf of Licensee. - - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pc/iso2opl/src/iso2opl.h b/pc/iso2opl/src/iso2opl.h index 435e50e13..d451fc2ff 100644 --- a/pc/iso2opl/src/iso2opl.h +++ b/pc/iso2opl/src/iso2opl.h @@ -21,9 +21,9 @@ #include #include -#define PROGRAM_NAME "iso2opl" +#define PROGRAM_NAME "iso2opl" #define PROGRAM_EXTNAME "ISO installer for Open PS2 Loader" -#define PROGRAM_VER "0.1.2" +#define PROGRAM_VER "0.1.2" typedef unsigned char u8; typedef unsigned short u16; diff --git a/pc/opl2iso/src/opl2iso.c b/pc/opl2iso/src/opl2iso.c index ade48b58c..d4bdbbc39 100644 --- a/pc/opl2iso/src/opl2iso.c +++ b/pc/opl2iso/src/opl2iso.c @@ -13,7 +13,7 @@ u32 crctab[0x400]; -#define EXIT_OK 0 +#define EXIT_OK 0 #define EXIT_FAILURE 1 //----------------------------------------------------------------------- diff --git a/pc/opl2iso/src/opl2iso.h b/pc/opl2iso/src/opl2iso.h index 954eacce7..bea672e16 100644 --- a/pc/opl2iso/src/opl2iso.h +++ b/pc/opl2iso/src/opl2iso.h @@ -22,9 +22,9 @@ #include #include -#define PROGRAM_NAME "opl2iso" +#define PROGRAM_NAME "opl2iso" #define PROGRAM_EXTNAME "UL.CFG to ISO converter" -#define PROGRAM_VER "0.0.2" +#define PROGRAM_VER "0.0.2" typedef unsigned char u8; typedef unsigned short u16; diff --git a/src/dia.c b/src/dia.c index a41b6f9d2..001dcbe5f 100644 --- a/src/dia.c +++ b/src/dia.c @@ -16,16 +16,16 @@ #include "include/sound.h" // UI spacing of the dialogues (pixels between consecutive items) -#define UI_SPACING_H 10 -#define UI_SPACING_V 2 +#define UI_SPACING_H 10 +#define UI_SPACING_V 2 // spacer ui element width (simulates tab) -#define UI_SPACER_WIDTH 50 +#define UI_SPACER_WIDTH 50 // minimal pixel width of spacer #define UI_SPACER_MINIMAL 30 // length of breaking line in pixels -#define UI_BREAK_LEN 600 +#define UI_BREAK_LEN 600 // scroll speed (delay in ms!) when in dialogs -#define DIA_SCROLL_SPEED 300 +#define DIA_SCROLL_SPEED 300 // scroll speed (delay in ms!) when setting int value #define DIA_INT_SET_SPEED 100 @@ -33,10 +33,10 @@ static int screenWidth; static int screenHeight; // Utility stuff -#define KEYB_MODE 2 -#define KEYB_WIDTH 12 +#define KEYB_MODE 2 +#define KEYB_WIDTH 12 #define KEYB_HEIGHT 4 -#define KEYB_ITEMS (KEYB_WIDTH * KEYB_HEIGHT) +#define KEYB_ITEMS (KEYB_WIDTH * KEYB_HEIGHT) static void diaDrawBoundingBox(int x, int y, int w, int h, int focus) { diff --git a/src/fntsys.c b/src/fntsys.c index d00b49aae..b749be089 100644 --- a/src/fntsys.c +++ b/src/fntsys.c @@ -21,9 +21,9 @@ extern void *poeveticanew_raw; extern int size_poeveticanew_raw; /// Maximal count of atlases per font -#define ATLAS_MAX 4 +#define ATLAS_MAX 4 /// Atlas width in pixels -#define ATLAS_WIDTH 256 +#define ATLAS_WIDTH 256 /// Atlas height in pixels #define ATLAS_HEIGHT 256 diff --git a/src/gui.c b/src/gui.c index fd71e6c1e..234edcba5 100644 --- a/src/gui.c +++ b/src/gui.c @@ -96,10 +96,10 @@ static gui_screen_handler_t *screenHandlerTarget = NULL; static int transIndex; // Helper perlin noise data -#define PLASMA_H 32 -#define PLASMA_W 32 +#define PLASMA_H 32 +#define PLASMA_W 32 #define PLASMA_ROWS_PER_FRAME 6 -#define FADE_SIZE 256 +#define FADE_SIZE 256 static GSTEXTURE gBackgroundTex; static int pperm[512]; @@ -1008,8 +1008,8 @@ static void VU0MixVec(VU_VECTOR *a, VU_VECTOR *b, float mix, VU_VECTOR *res) "vmaddx.xyzw vf1, vf2, vf4x\n" // multiply vf2 by vf4.x add ACC, store the result in vf1 "sqc2 vf1, (%[res])\n" // transfer the result in acc to the ee #endif - : [ res ] "+r"(res), "=m"(*res) - : [ a ] "r"(a), [ b ] "r"(b), [ mix ] "r"(mix), "m"(*a), "m"(*b)); + : [res] "+r"(res), "=m"(*res) + : [a] "r"(a), [b] "r"(b), [mix] "r"(mix), "m"(*a), "m"(*b)); } static float guiCalcPerlin(float x, float y, float z) diff --git a/src/guigame.c b/src/guigame.c index 12d8c866e..4f78becee 100644 --- a/src/guigame.c +++ b/src/guigame.c @@ -84,11 +84,11 @@ typedef struct char VMC_msg[64]; } statusVMCparam_t; -#define OPERATION_CREATE 0 +#define OPERATION_CREATE 0 #define OPERATION_CREATING 1 #define OPERATION_ABORTING 2 -#define OPERATION_ENDING 3 -#define OPERATION_END 4 +#define OPERATION_ENDING 3 +#define OPERATION_END 4 static short vmc_refresh; static int vmc_operation; diff --git a/src/hdd.c b/src/hdd.c index def4a200a..bac9fa552 100644 --- a/src/hdd.c +++ b/src/hdd.c @@ -28,7 +28,7 @@ typedef struct // size = 1024 } hdl_apa_header; #define HDL_GAME_DATA_OFFSET 0x100000 // Sector 0x800 in the extended attribute area. -#define HDL_FS_MAGIC 0x1337 +#define HDL_FS_MAGIC 0x1337 static unsigned char IOBuffer[1024] ALIGNED(64); diff --git a/src/hddsupport.c b/src/hddsupport.c index e6b33fc5b..8f21f105b 100644 --- a/src/hddsupport.c +++ b/src/hddsupport.c @@ -54,7 +54,7 @@ static void hddInitModules(void) // HD Pro Kit is mapping the 1st word in ROM0 seg as a main ATA controller, // The pseudo ATA controller registers are accessed (input/ouput) by writing // an id to the main ATA controller -#define HDPROreg_IO8 (*(volatile unsigned char *)0xBFC00000) +#define HDPROreg_IO8 (*(volatile unsigned char *)0xBFC00000) #define CDVDreg_STATUS (*(volatile unsigned char *)0xBF40200A) static int hddCheckHDProKit(void) @@ -91,7 +91,7 @@ static int hddCheckHDProKit(void) //Taken from libhdd: #define PFS_ZONE_SIZE 8192 -#define PFS_FRAGMENT 0x00000000 +#define PFS_FRAGMENT 0x00000000 static int CreateOPLPartition(const char *oplPart, const char *mountpoint) { diff --git a/src/opl.c b/src/opl.c index de62d2ef8..f225b0cb2 100644 --- a/src/opl.c +++ b/src/opl.c @@ -1105,8 +1105,8 @@ int saveConfig(int types, int showUI) return lscret; } -#define COMPAT_UPD_MODE_UPD_USR 1 //Update all records, even those that were modified by the user. -#define COMPAT_UPD_MODE_NO_MTIME 2 //Do not check the modified time-stamp. +#define COMPAT_UPD_MODE_UPD_USR 1 //Update all records, even those that were modified by the user. +#define COMPAT_UPD_MODE_NO_MTIME 2 //Do not check the modified time-stamp. #define COMPAT_UPD_MODE_MTIME_GMT 4 //Modified time-stamp is in GMT, not JST. #define EOPLCONNERR 0x4000 //Special error code for connection errors. diff --git a/src/system.c b/src/system.c index 4eb92e74c..e65090ac6 100644 --- a/src/system.c +++ b/src/system.c @@ -57,7 +57,7 @@ extern unsigned int size_eesync_irx; #define MAX_MODULES 32 static void *g_sysLoadedModBuffer[MAX_MODULES]; -#define ELF_MAGIC 0x464c457f +#define ELF_MAGIC 0x464c457f #define ELF_PT_LOAD 1 typedef struct @@ -351,11 +351,11 @@ void sysExecExit(void) } //Module bits -#define CORE_IRX_USB 0x01 -#define CORE_IRX_ETH 0x02 -#define CORE_IRX_SMB 0x04 -#define CORE_IRX_HDD 0x08 -#define CORE_IRX_VMC 0x10 +#define CORE_IRX_USB 0x01 +#define CORE_IRX_ETH 0x02 +#define CORE_IRX_SMB 0x04 +#define CORE_IRX_HDD 0x08 +#define CORE_IRX_VMC 0x10 #define CORE_IRX_DEBUG 0x20 #define CORE_IRX_DECI2 0x40 #define CORE_IRX_ILINK 0x80 @@ -787,7 +787,7 @@ void sysLaunchLoaderElf(const char *filename, const char *mode_str, int size_cdv #ifdef PADEMU #define PADEMU_SPECIFIER " %d, %u" -#define PADEMU_ARGUMENT , gEnablePadEmu, (unsigned int)(gPadEmuSettings >> 8) +#define PADEMU_ARGUMENT , gEnablePadEmu, (unsigned int)(gPadEmuSettings >> 8) #else #define PADEMU_SPECIFIER #define PADEMU_ARGUMENT diff --git a/src/themes.c b/src/themes.c index 7046022ad..e977cb38a 100644 --- a/src/themes.c +++ b/src/themes.c @@ -10,8 +10,8 @@ #include "include/pad.h" #include "include/sound.h" -#define MENU_POS_V 50 -#define HINT_HEIGHT 32 +#define MENU_POS_V 50 +#define HINT_HEIGHT 32 #define DECORATOR_SIZE 20 extern const char conf_theme_OPL_cfg; @@ -50,9 +50,9 @@ enum ELEM_ATTRIBUTE_TYPE { ELEM_TYPE_COUNT }; -#define DISPLAY_ALWAYS 0 +#define DISPLAY_ALWAYS 0 #define DISPLAY_DEFINED 1 -#define DISPLAY_NEVER 2 +#define DISPLAY_NEVER 2 #define SIZING_NONE -1 #define SIZING_CLIP 0