added missing ioctl for handling link state change. I noted it's not supported on my bcm440x chipset

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21060 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2007-05-07 18:08:55 +00:00
parent 34cbbba798
commit d752ee3be8
4 changed files with 52 additions and 2 deletions

View File

@ -82,6 +82,10 @@ struct be_b44_dev {
int block;
spinlock lock;
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
sem_id linkChangeSem;
#endif
};
struct B_UM_PACKET {

View File

@ -109,6 +109,9 @@ init_driver(void)
be_b44_dev_cards[sCardsFound].opened = 0;
be_b44_dev_cards[sCardsFound].block = 1;
be_b44_dev_cards[sCardsFound].lock = 0;
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
be_b44_dev_cards[sCardsFound].linkChangeSem = -1;
#endif
if (b44_LM_GetAdapterInfo(&be_b44_dev_cards[sCardsFound].lm_dev) != LM_STATUS_SUCCESS)
return ENODEV;
@ -216,7 +219,7 @@ b44_free(void *cookie)
status_t
b44_ioctl(void *cookie,uint32 op,void *data,size_t len)
b44_ioctl(void *cookie,uint32 op, void *data, size_t len)
{
struct be_b44_dev *pUmDevice = (struct be_b44_dev *)cookie;
@ -278,6 +281,16 @@ b44_ioctl(void *cookie,uint32 op,void *data,size_t len)
return user_memcpy(data, &state, sizeof(ether_link_state_t));
}
case ETHER_SET_LINK_STATE_SEM:
{
if (user_memcpy(&pUmDevice->linkChangeSem, data, sizeof(sem_id)) < B_OK) {
pUmDevice->linkChangeSem = -1;
return B_BAD_ADDRESS;
}
return B_OK;
}
#endif
}
return B_ERROR;
@ -600,6 +613,14 @@ b44_MM_GetConfig(PLM_DEVICE_BLOCK pDevice)
LM_STATUS
b44_MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status)
{
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
struct be_b44_dev *pUmDevice = (struct be_b44_dev *)pDevice;
if (pUmDevice->linkChangeSem != -1)
release_sem_etc(pUmDevice->linkChangeSem, 1,
B_DO_NOT_RESCHEDULE);
#endif
return LM_STATUS_SUCCESS;
}

View File

@ -327,6 +327,9 @@ init_driver(void)
be_b57_dev_cards[cards_found].opened = 0;
be_b57_dev_cards[cards_found].block = 1;
be_b57_dev_cards[cards_found].lock = 0;
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
be_b57_dev_cards[cards_found].linkChangeSem = -1;
#endif
if (LM_GetAdapterInfo(&be_b57_dev_cards[cards_found].lm_dev) != LM_STATUS_SUCCESS) {
put_module(B_PCI_MODULE_NAME);
@ -519,6 +522,15 @@ b57_ioctl(void *cookie,uint32 op,void *data,size_t len)
return user_memcpy(data, &state, sizeof(ether_link_state_t));
}
case ETHER_SET_LINK_STATE_SEM:
{
if (user_memcpy(&pUmDevice->linkChangeSem, data, sizeof(sem_id)) < B_OK) {
pUmDevice->linkChangeSem = -1;
return B_BAD_ADDRESS;
}
return B_OK;
}
#endif
}
return B_ERROR;
@ -909,7 +921,16 @@ MM_GetConfig(PLM_DEVICE_BLOCK pDevice)
LM_STATUS
MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status) {
MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status)
{
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
struct be_b57_dev *pUmDevice = (struct be_b57_dev *)pDevice;
if (pUmDevice->linkChangeSem != -1)
release_sem_etc(pUmDevice->linkChangeSem, 1,
B_DO_NOT_RESCHEDULE);
#endif
return LM_STATUS_SUCCESS;
}

View File

@ -84,6 +84,10 @@ struct be_b57_dev {
int block;
spinlock lock;
cpu_status cpu;
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
sem_id linkChangeSem;
#endif
};
struct B_UM_PACKET {