Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 514932 | Differences between
and this patch

Collapse All | Expand All

(-)a/Makefile (-2 / +5 lines)
Lines 189-199 CROSS_COMPILE = mips-wrs-linux-gnu- Link Here
189
endif
189
endif
190
190
191
ifeq ($(PLATFORM),PC)
191
ifeq ($(PLATFORM),PC)
192
ifndef KERN_VER
193
KERN_VER = $(shell uname -r)
194
endif
192
# Linux 2.6
195
# Linux 2.6
193
LINUX_SRC = /lib/modules/$(shell uname -r)/build
196
LINUX_SRC = /lib/modules/$(KERN_VER)/build
194
# Linux 2.4 Change to your local setting
197
# Linux 2.4 Change to your local setting
195
#LINUX_SRC = /usr/src/linux-2.4
198
#LINUX_SRC = /usr/src/linux-2.4
196
LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/
199
LINUX_SRC_MODULE = /lib/modules/$(KERN_VER)/kernel/drivers/net/wireless/
197
CROSS_COMPILE = 
200
CROSS_COMPILE = 
198
endif
201
endif
199
202
(-)a/include/os/rt_linux.h (-4 / +4 lines)
Lines 6-12 Link Here
6
 * Taiwan, R.O.C.
6
 * Taiwan, R.O.C.
7
 *
7
 *
8
 * (c) Copyright 2002-2010, Ralink Technology, Inc.
8
 * (c) Copyright 2002-2010, Ralink Technology, Inc.
9
 *
9
 * Portions © 2013 Jesse Crews <jcrews at gridlox dot net>
10
 * This program is free software; you can redistribute it and/or modify  *
10
 * This program is free software; you can redistribute it and/or modify  *
11
 * it under the terms of the GNU General Public License as published by  *
11
 * it under the terms of the GNU General Public License as published by  *
12
 * the Free Software Foundation; either version 2 of the License, or     *
12
 * the Free Software Foundation; either version 2 of the License, or     *
Lines 996-1010 void linux_pci_unmap_single(void *handle, ra_dma_addr_t dma_addr, size_t size, i Link Here
996
		(RTPKT_TO_OSPKT(_pkt)->len) = (_len)
996
		(RTPKT_TO_OSPKT(_pkt)->len) = (_len)
997
		
997
		
998
#define GET_OS_PKT_DATATAIL(_pkt) \
998
#define GET_OS_PKT_DATATAIL(_pkt) \
999
		(RTPKT_TO_OSPKT(_pkt)->tail)
999
		((unsigned char*)skb_tail_pointer(RTPKT_TO_OSPKT(_pkt)))
1000
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len)	\
1000
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len)	\
1001
		((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))
1001
		(skb_set_tail_pointer((RTPKT_TO_OSPKT(_pkt)), (_len)))
1002
		
1002
		
1003
#define GET_OS_PKT_HEAD(_pkt) \
1003
#define GET_OS_PKT_HEAD(_pkt) \
1004
		(RTPKT_TO_OSPKT(_pkt)->head)
1004
		(RTPKT_TO_OSPKT(_pkt)->head)
1005
1005
1006
#define GET_OS_PKT_END(_pkt) \
1006
#define GET_OS_PKT_END(_pkt) \
1007
		(RTPKT_TO_OSPKT(_pkt)->end)
1007
		((unsigned char*)skb_end_pointer(RTPKT_TO_OSPKT(_pkt)))
1008
1008
1009
#define GET_OS_PKT_NETDEV(_pkt) \
1009
#define GET_OS_PKT_NETDEV(_pkt) \
1010
		(RTPKT_TO_OSPKT(_pkt)->dev)
1010
		(RTPKT_TO_OSPKT(_pkt)->dev)
(-)a/os/linux/Makefile.4 (-2 / +5 lines)
Lines 9-14 DAT_FILE_NAME = RT$(MODULE_DAT)STA.dat Link Here
9
endif
9
endif
10
#endif // CONFIG_STA_SUPPORT //
10
#endif // CONFIG_STA_SUPPORT //
11
11
12
ifndef KERN_VER
13
KERN_VER = $(shell uname -r)
14
endif
12
15
13
16
14
OBJ := $(MOD_NAME).o
17
OBJ := $(MOD_NAME).o
Lines 280-291 install: Link Here
280
	cp $(RT28xx_DIR)/$(DAT_FILE_NAME) $(DAT_PATH)/.
283
	cp $(RT28xx_DIR)/$(DAT_FILE_NAME) $(DAT_PATH)/.
281
	install -d $(LINUX_SRC_MODULE)
284
	install -d $(LINUX_SRC_MODULE)
282
	install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE)
285
	install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE)
283
	/sbin/depmod -a ${shell uname -r}
286
	/sbin/depmod -a ${KERN_VER}
284
287
285
uninstall:
288
uninstall:
286
#	rm -rf $(DAT_PATH)
289
#	rm -rf $(DAT_PATH)
287
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME)))
290
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME)))
288
	/sbin/depmod -a ${shell uname -r}
291
	/sbin/depmod -a ${KERN_VER}
289
292
290
# Declare the contents of the .PHONY variable as phony.  We keep that
293
# Declare the contents of the .PHONY variable as phony.  We keep that
291
# information in a variable so we can use it in if_changed and friends.
294
# information in a variable so we can use it in if_changed and friends.
(-)a/os/linux/Makefile.4.netif (-2 / +6 lines)
Lines 8-13 endif Link Here
8
#endif // CONFIG_STA_SUPPORT //
8
#endif // CONFIG_STA_SUPPORT //
9
9
10
10
11
ifndef KERN_VER
12
KERN_VER = $(shell uname -r)
13
endif
14
11
OBJ := $(MOD_NAME).o
15
OBJ := $(MOD_NAME).o
12
16
13
17
Lines 94-104 endif Link Here
94
install:
98
install:
95
	install -d $(LINUX_SRC_MODULE)
99
	install -d $(LINUX_SRC_MODULE)
96
	install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE)
100
	install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE)
97
	/sbin/depmod -a ${shell uname -r}
101
	/sbin/depmod -a ${KERN_VER}
98
102
99
uninstall:
103
uninstall:
100
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME)))
104
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME)))
101
	/sbin/depmod -a ${shell uname -r}
105
	/sbin/depmod -a ${KERN_VER}
102
106
103
# Declare the contents of the .PHONY variable as phony.  We keep that
107
# Declare the contents of the .PHONY variable as phony.  We keep that
104
# # information in a variable so we can use it in if_changed and friends.
108
# # information in a variable so we can use it in if_changed and friends.
(-)a/os/linux/Makefile.4.util (-2 / +5 lines)
Lines 7-12 MOD_NAME = rtutil$(MODULE)sta Link Here
7
endif
7
endif
8
#endif // CONFIG_STA_SUPPORT //
8
#endif // CONFIG_STA_SUPPORT //
9
9
10
ifndef KERN_VER
11
KERN_VER = $(shell uname -r)
12
endif
10
13
11
OBJ := $(MOD_NAME).o
14
OBJ := $(MOD_NAME).o
12
15
Lines 65-75 endif Link Here
65
install:
68
install:
66
	install -d $(LINUX_SRC_MODULE)
69
	install -d $(LINUX_SRC_MODULE)
67
	install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE)
70
	install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE)
68
	/sbin/depmod -a ${shell uname -r}
71
	/sbin/depmod -a ${KERN_VER}
69
72
70
uninstall:
73
uninstall:
71
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME)))
74
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME)))
72
	/sbin/depmod -a ${shell uname -r}
75
	/sbin/depmod -a ${KERN_VER}
73
76
74
# Declare the contents of the .PHONY variable as phony.  We keep that
77
# Declare the contents of the .PHONY variable as phony.  We keep that
75
# # information in a variable so we can use it in if_changed and friends.
78
# # information in a variable so we can use it in if_changed and friends.
(-)a/os/linux/Makefile.6 (-2 / +5 lines)
Lines 9-14 DAT_FILE_NAME = RT$(CHIPSET_DAT)STA.dat Link Here
9
endif
9
endif
10
#endif // CONFIG_STA_SUPPORT //
10
#endif // CONFIG_STA_SUPPORT //
11
11
12
ifndef KERN_VER
13
KERN_VER = $(shell uname -r)
14
endif
12
15
13
obj-m := $(MOD_NAME).o
16
obj-m := $(MOD_NAME).o
14
17
Lines 297-308 install: Link Here
297
	cp $(RT28xx_DIR)/$(DAT_FILE_NAME) $(DAT_PATH)/.
300
	cp $(RT28xx_DIR)/$(DAT_FILE_NAME) $(DAT_PATH)/.
298
	install -d $(LINUX_SRC_MODULE)
301
	install -d $(LINUX_SRC_MODULE)
299
	install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE)
302
	install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE)
300
	/sbin/depmod -a ${shell uname -r}
303
	/sbin/depmod -a ${KERN_VER}
301
304
302
uninstall:
305
uninstall:
303
#	rm -rf $(DAT_PATH)
306
#	rm -rf $(DAT_PATH)
304
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME)))
307
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME)))
305
	/sbin/depmod -a ${shell uname -r}
308
	/sbin/depmod -a ${KERN_VER}
306
309
307
# Declare the contents of the .PHONY variable as phony.  We keep that
310
# Declare the contents of the .PHONY variable as phony.  We keep that
308
# information in a variable so we can use it in if_changed and friends.
311
# information in a variable so we can use it in if_changed and friends.
(-)a/os/linux/Makefile.6.netif (-2 / +5 lines)
Lines 7-12 MOD_NAME = rtnet$(MODULE)sta Link Here
7
endif
7
endif
8
#endif // CONFIG_STA_SUPPORT //
8
#endif // CONFIG_STA_SUPPORT //
9
9
10
ifndef KERN_VER
11
KERN_VER = $(shell uname -r)
12
endif
10
13
11
obj-m := $(MOD_NAME).o
14
obj-m := $(MOD_NAME).o
12
15
Lines 90-97 endif Link Here
90
install:
93
install:
91
	install -d $(LINUX_SRC_MODULE)
94
	install -d $(LINUX_SRC_MODULE)
92
	install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE)
95
	install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE)
93
	/sbin/depmod -a ${shell uname -r}
96
	/sbin/depmod -a ${KERN_VER}
94
97
95
uninstall:
98
uninstall:
96
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME)))
99
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME)))
97
	/sbin/depmod -a ${shell uname -r}
100
	/sbin/depmod -a ${KERN_VER}
(-)a/os/linux/Makefile.6.util (-2 / +5 lines)
Lines 7-12 MOD_NAME = rtutil$(MODULE)sta Link Here
7
endif
7
endif
8
#endif // CONFIG_STA_SUPPORT //
8
#endif // CONFIG_STA_SUPPORT //
9
9
10
ifndef KERN_VER
11
KERN_VER = $(shell uname -r)
12
endif
10
13
11
obj-m := $(MOD_NAME).o
14
obj-m := $(MOD_NAME).o
12
15
Lines 50-57 endif Link Here
50
install:
53
install:
51
	install -d $(LINUX_SRC_MODULE)
54
	install -d $(LINUX_SRC_MODULE)
52
	install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE)
55
	install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE)
53
	/sbin/depmod -a ${shell uname -r}
56
	/sbin/depmod -a ${KERN_VER}
54
57
55
uninstall:
58
uninstall:
56
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME)))
59
	rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME)))
57
	/sbin/depmod -a ${shell uname -r}
60
	/sbin/depmod -a ${KERN_VER}
(-)a/os/linux/pci_main_dev.c (-3 / +22 lines)
Lines 6-12 Link Here
6
 * Taiwan, R.O.C.
6
 * Taiwan, R.O.C.
7
 *
7
 *
8
 * (c) Copyright 2002-2010, Ralink Technology, Inc.
8
 * (c) Copyright 2002-2010, Ralink Technology, Inc.
9
 *
9
 * Portions © 2013, Jesse Crews <jcrews at gridlox dot net>
10
 * This program is free software; you can redistribute it and/or modify  *
10
 * This program is free software; you can redistribute it and/or modify  *
11
 * it under the terms of the GNU General Public License as published by  *
11
 * it under the terms of the GNU General Public License as published by  *
12
 * the Free Software Foundation; either version 2 of the License, or     *
12
 * the Free Software Foundation; either version 2 of the License, or     *
Lines 39-46 Link Here
39
/*extern int rt28xx_close(IN struct net_device *net_dev); */
39
/*extern int rt28xx_close(IN struct net_device *net_dev); */
40
/*extern int rt28xx_open(struct net_device *net_dev); */
40
/*extern int rt28xx_open(struct net_device *net_dev); */
41
41
42
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
43
static VOID rt2860_remove_one(struct pci_dev *pci_dev);
44
static INT rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id  *ent);
45
#else
42
static VOID __devexit rt2860_remove_one(struct pci_dev *pci_dev);
46
static VOID __devexit rt2860_remove_one(struct pci_dev *pci_dev);
43
static INT __devinit rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id  *ent);
47
static INT __devinit rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id  *ent);
48
#endif
49
44
static void __exit rt2860_cleanup_module(void);
50
static void __exit rt2860_cleanup_module(void);
45
static int __init rt2860_init_module(void);
51
static int __init rt2860_init_module(void);
46
52
Lines 59-65 static int rt2860_resume(struct pci_dev *pci_dev); Link Here
59
/* */
65
/* */
60
/* Ralink PCI device table, include all supported chipsets */
66
/* Ralink PCI device table, include all supported chipsets */
61
/* */
67
/* */
68
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
69
static struct pci_device_id rt2860_pci_tbl[] =
70
#else
62
static struct pci_device_id rt2860_pci_tbl[] __devinitdata =
71
static struct pci_device_id rt2860_pci_tbl[] __devinitdata =
72
#endif
63
{
73
{
64
#ifdef RT5592
74
#ifdef RT5592
65
	{PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC5592_PCIe_DEVICE_ID)},
75
	{PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC5592_PCIe_DEVICE_ID)},
Lines 86-96 static struct pci_driver rt2860_driver = Link Here
86
    name:       RTMP_DRV_NAME,
96
    name:       RTMP_DRV_NAME,
87
    id_table:   rt2860_pci_tbl,
97
    id_table:   rt2860_pci_tbl,
88
    probe:      rt2860_probe,
98
    probe:      rt2860_probe,
89
#if LINUX_VERSION_CODE >= 0x20412
99
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) /* 3.8 check */
100
#if LINUX_VERSION_CODE >= 0x20412 
90
    remove:     __devexit_p(rt2860_remove_one),
101
    remove:     __devexit_p(rt2860_remove_one),
91
#else
102
#else
92
    remove:     __devexit(rt2860_remove_one),
103
    remove:     __devexit(rt2860_remove_one),
93
#endif
104
#endif
105
#endif /* 3.8 check */
94
106
95
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
107
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
96
#ifdef CONFIG_PM
108
#ifdef CONFIG_PM
Lines 291-297 module_exit(rt2860_cleanup_module); Link Here
291
/* */
303
/* */
292
/* PCI device probe & initialization function */
304
/* PCI device probe & initialization function */
293
/* */
305
/* */
306
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
307
static INT  rt2860_probe(
308
#else 
294
static INT __devinit   rt2860_probe(
309
static INT __devinit   rt2860_probe(
310
#endif
295
    IN  struct pci_dev              *pci_dev, 
311
    IN  struct pci_dev              *pci_dev, 
296
    IN  const struct pci_device_id  *pci_id)
312
    IN  const struct pci_device_id  *pci_id)
297
{
313
{
Lines 461-468 err_out: Link Here
461
	return -ENODEV; /* probe fail */
477
	return -ENODEV; /* probe fail */
462
}
478
}
463
479
464
480
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
481
static VOID rt2860_remove_one(
482
#else
465
static VOID __devexit rt2860_remove_one(
483
static VOID __devexit rt2860_remove_one(
484
#endif
466
    IN  struct pci_dev  *pci_dev)
485
    IN  struct pci_dev  *pci_dev)
467
{
486
{
468
	PNET_DEV	net_dev = pci_get_drvdata(pci_dev);
487
	PNET_DEV	net_dev = pci_get_drvdata(pci_dev);
(-)a/os/linux/rt_linux.c (-6 / +6 lines)
Lines 6-12 Link Here
6
 * Taiwan, R.O.C.
6
 * Taiwan, R.O.C.
7
 *
7
 *
8
 * (c) Copyright 2002-2010, Ralink Technology, Inc.
8
 * (c) Copyright 2002-2010, Ralink Technology, Inc.
9
 *
9
 * Portions © Jesse Crews <jcrews at gridlox dot net>
10
 * This program is free software; you can redistribute it and/or modify  *
10
 * This program is free software; you can redistribute it and/or modify  *
11
 * it under the terms of the GNU General Public License as published by  *
11
 * it under the terms of the GNU General Public License as published by  *
12
 * the Free Software Foundation; either version 2 of the License, or     *
12
 * the Free Software Foundation; either version 2 of the License, or     *
Lines 502-510 PNDIS_PACKET duplicate_pkt( Link Here
502
		MEM_DBG_PKT_ALLOC_INC(skb);
502
		MEM_DBG_PKT_ALLOC_INC(skb);
503
503
504
		skb_reserve(skb, 2);
504
		skb_reserve(skb, 2);
505
		NdisMoveMemory(skb->tail, pHeader802_3, HdrLen);
505
		NdisMoveMemory((unsigned char*)skb_tail_pointer(skb), pHeader802_3, HdrLen);
506
		skb_put(skb, HdrLen);
506
		skb_put(skb, HdrLen);
507
		NdisMoveMemory(skb->tail, pData, DataSize);
507
		NdisMoveMemory((unsigned char*)skb_tail_pointer(skb), pData, DataSize);
508
		skb_put(skb, DataSize);
508
		skb_put(skb, DataSize);
509
		skb->dev = pNetDev;	/*get_netdev_from_bssid(pAd, FromWhichBSSID); */
509
		skb->dev = pNetDev;	/*get_netdev_from_bssid(pAd, FromWhichBSSID); */
510
		pPacket = OSPKT_TO_RTPKT(skb);
510
		pPacket = OSPKT_TO_RTPKT(skb);
Lines 656-662 PNDIS_PACKET ClonePacket( Link Here
656
		pClonedPkt->dev = pRxPkt->dev;
656
		pClonedPkt->dev = pRxPkt->dev;
657
		pClonedPkt->data = pData;
657
		pClonedPkt->data = pData;
658
		pClonedPkt->len = DataSize;
658
		pClonedPkt->len = DataSize;
659
		pClonedPkt->tail = pClonedPkt->data + pClonedPkt->len;
659
		skb_set_tail_pointer(pClonedPkt, DataSize);
660
		ASSERT(DataSize < 1530);
660
		ASSERT(DataSize < 1530);
661
	}
661
	}
662
	return pClonedPkt;
662
	return pClonedPkt;
Lines 702-708 void wlan_802_11_to_802_3_packet( Link Here
702
	pOSPkt->dev = pNetDev;
702
	pOSPkt->dev = pNetDev;
703
	pOSPkt->data = pData;
703
	pOSPkt->data = pData;
704
	pOSPkt->len = DataSize;
704
	pOSPkt->len = DataSize;
705
	pOSPkt->tail = pOSPkt->data + pOSPkt->len;
705
	skb_set_tail_pointer(pOSPkt, DataSize);
706
706
707
	/* */
707
	/* */
708
	/* copy 802.3 header */
708
	/* copy 802.3 header */
Lines 4933-4939 Note: Link Here
4933
*/
4933
*/
4934
VOID RtmpOsPktTailAdjust(IN PNDIS_PACKET pNetPkt,
4934
VOID RtmpOsPktTailAdjust(IN PNDIS_PACKET pNetPkt,
4935
			 IN UINT removedTagLen) {
4935
			 IN UINT removedTagLen) {
4936
	OS_PKT_TAIL_ADJUST(pNetPkt, removedTagLen);
4936
	skb_set_tail_pointer(pNetPkt, pNetPkt->len - removedTagLen)
4937
}
4937
}
4938
4938
4939
/*
4939
/*

Return to bug 514932