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:
parent
34cbbba798
commit
d752ee3be8
@ -82,6 +82,10 @@ struct be_b44_dev {
|
|||||||
|
|
||||||
int block;
|
int block;
|
||||||
spinlock lock;
|
spinlock lock;
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
|
sem_id linkChangeSem;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct B_UM_PACKET {
|
struct B_UM_PACKET {
|
||||||
|
@ -109,6 +109,9 @@ init_driver(void)
|
|||||||
be_b44_dev_cards[sCardsFound].opened = 0;
|
be_b44_dev_cards[sCardsFound].opened = 0;
|
||||||
be_b44_dev_cards[sCardsFound].block = 1;
|
be_b44_dev_cards[sCardsFound].block = 1;
|
||||||
be_b44_dev_cards[sCardsFound].lock = 0;
|
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)
|
if (b44_LM_GetAdapterInfo(&be_b44_dev_cards[sCardsFound].lm_dev) != LM_STATUS_SUCCESS)
|
||||||
return ENODEV;
|
return ENODEV;
|
||||||
@ -216,7 +219,7 @@ b44_free(void *cookie)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
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;
|
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));
|
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
|
#endif
|
||||||
}
|
}
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@ -600,6 +613,14 @@ b44_MM_GetConfig(PLM_DEVICE_BLOCK pDevice)
|
|||||||
LM_STATUS
|
LM_STATUS
|
||||||
b44_MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS 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;
|
return LM_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,6 +327,9 @@ init_driver(void)
|
|||||||
be_b57_dev_cards[cards_found].opened = 0;
|
be_b57_dev_cards[cards_found].opened = 0;
|
||||||
be_b57_dev_cards[cards_found].block = 1;
|
be_b57_dev_cards[cards_found].block = 1;
|
||||||
be_b57_dev_cards[cards_found].lock = 0;
|
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) {
|
if (LM_GetAdapterInfo(&be_b57_dev_cards[cards_found].lm_dev) != LM_STATUS_SUCCESS) {
|
||||||
put_module(B_PCI_MODULE_NAME);
|
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));
|
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
|
#endif
|
||||||
}
|
}
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@ -909,7 +921,16 @@ MM_GetConfig(PLM_DEVICE_BLOCK pDevice)
|
|||||||
|
|
||||||
|
|
||||||
LM_STATUS
|
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;
|
return LM_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +84,10 @@ struct be_b57_dev {
|
|||||||
int block;
|
int block;
|
||||||
spinlock lock;
|
spinlock lock;
|
||||||
cpu_status cpu;
|
cpu_status cpu;
|
||||||
|
|
||||||
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
|
sem_id linkChangeSem;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct B_UM_PACKET {
|
struct B_UM_PACKET {
|
||||||
|
Loading…
Reference in New Issue
Block a user