• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: "Sandeep Kumar" <email@hidden>
  • Date: 15 Feb 2011 11:31:36 -0000
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

Hi,

I need help to support Jumbo packet support for our ethernet driver. I implemented below
code for the same:


SInt32 IOEthernetInterface::performCommand(
kMCCI_CDC_DATA_DRIVER_CLASS_NAME *
ctr,
UInt32 cmd,
void * arg0,
void * arg1
)
{
SInt32 ret;
assert( arg0 == _arpcom );
if ( ctr == 0 )
return EINVAL;

switch (cmd)
{
case SIOCSIFMTU:
case SIOCGIFDEVMTU:
case SIOCGIFMTU:

ret = (int) ctr->executeCommand(
this, /* client */
(IONetworkController::Action)

&IOEthernetInterface::performGatedCommand,
this, /* target */
ctr, /* param0 */
(void *) cmd, /* param1 */
arg0, /* param2 */
arg1 ); /* param3 */
break;

default:
ret = super::performCommand(ctr,cmd,arg0,arg1);
break;
}

return ret;
}

int IOEthernetInterface::performGatedCommand(void * target,
void * arg1_ctr,
void * arg2_cmd,
void * arg3_0,
void * arg4_1)
)
{
IOEthernetInterface * self = (IOEthernetInterface *) target;
IONetworkController * ctr = (IONetworkController *) arg1_ctr;
struct ifreq * ifr = (struct ifreq *) arg4_1;
SInt ret = EOPNOTSUPP;

switch ( (UInt32) arg2_cmd )
{
case SIOCSIFMTU:
ret = self->syncSIOCSIFMTU( ctr, ifr );
break;
}

return ret;
}

int IOEthernetInterface::syncSIOCSIFMTU( IONetworkController * ctr,
struct ifreq * ifr )
{
#define MTU_TO_FRAMESIZE(x)
((x) + kIOEthernetCRCSize + sizeof(struct ether_header))

SInt32 error = 0;
UInt32 size;
UInt32 maxSize = kIOEthernetMaxPacketSize; // 1518
UInt32 ifrSize = MTU_TO_FRAMESIZE( ifr->ifr_mtu );
UInt32 ctrSize = MTU_TO_FRAMESIZE( getMaxTransferUnit() );

// If change is not necessary, return success without getting the
// controller involved.

if ( ctrSize == ifrSize )
return 0; // no change required

if ( ctr->getMaxPacketSize( &size ) == kIOReturnSuccess )
maxSize = max( size, kIOEthernetMaxPacketSize );

if ( ifrSize > maxSize )
return EINVAL; // MTU is too large for the controller.

// Message the controller if the new MTU requires a non standard
// frame size, or if the controller is currently programmed to
// support an extended frame size which is no longer required.

if ( max( ifrSize, ctrSize ) > kIOEthernetMaxPacketSize )
{
IOReturn ret;
ret = ctr->setMaxPacketSize( max(ifrSize, kIOEthernetMaxPacketSize) );
error = errnoFromReturn( ret );
}

if ( error == 0 )
{
// Success, update the MTU in ifnet.
setMaxTransferUnit( ifr->ifr_mtu );
}

return error;
}


Function performcommand() is calling for getting mtu value, and it is showing MTU value as
9000. But it is not calling cmd for setting MTU value with the command "sudo ifconfig enNN
MTU 2000"
in 10.4, 10.5, and 10.6 MAC OS X environment.

It is not invoking below case:

-----------------------------------------------------------------------
------
case SIOCSIFMTU:
ret = self->syncSIOCSIFMTU( ctr, ifr );
----------------------------------------------

When I try to change MTU value with below command, it is showing error:

Macmini105:~ sandeepkumar$ sudo ifconfig en12 mtu 1600
ifconfig: ioctl (set mtu): Operation not supported on socket


Kindly help me, and guide what i m doing wrong or miss anything.

Thanks in advance,
Sandeep

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Jumbo support
  • Next by Date: Mime Types
  • Previous by thread: Jumbo support
  • Next by thread: Mime Types
  • Index(es):
    • Date
    • Thread