CS_DDR, CS_PORT, RESET_DDR, and RESET_PORT Mega2560

I am trying to use a c libary for an ethernet shield, but it is programmed for the ATMega644p, but I am using the ATMega2560. I am having some problems figuring out what ports i need to use instead.

The library can be seen here: Wiznet 5100 library

The specific place where I have problems is with this:

#define CS_DDR DDRD /* target-specific DDR for chip-select /
#define CS_PORT PORTD /
target-specific port used as chip-select /
#define CS_BIT 2 /
target-specific port line used as chip-select */

#define RESET_DDR DDRD /* target-specific DDR for reset /
#define RESET_PORT PORTD /
target-specific port used for reset /
#define RESET_BIT 3 /
target-specific port line used as reset */

I can't find anything in the documentation for the ATMega2560, I have tried everything. Please help.

Those need to point to the Data Direction Register, PORT register, and bit number for the pin connected to CS, and RESET on the W5100.

Find the pins corresponding to those, and look at the pinout chart to find what port/pin it is - pins will be marked something like PA3 or PB1 or PC0 etc etc - the letter after DDR and PORT is the letter after P, and the bit is the number.

Ie, in that case, the pin connected to CS would be marked PD2, and the one connected to reset (of the W5100) would be PD3.