Using Samba

Using Samba

Robert Eckstein, David Collier-Brown, Peter Kelly
1st Edition November 1999
1-56592-449-5, Order Number: 4495
416 pages, $34.95

Buy the hardcopy version


Table of Contents

License Information

This Edition

Chapter 1: Learning the Samba

Chapter 1.1: What is Samba?
Chapter 1.2: What Can Samba Do For Me?
Chapter 1.3: Getting Familiar with a SMB/CIFS Network
Chapter 1.4: Microsoft Implementations
Chapter 1.5: An Overview of the Samba Distribution
Chapter 1.6: How Can I Get Samba?
Chapter 1.7: What's New in Samba 2.0?
Chapter 1.8: And That's Not All...
Chapter 2: Installing Samba on a Unix System
Chapter 2.1: Downloading the Samba Distribution
Chapter 2.2: Configuring Samba
Chapter 2.3: Compiling and Installing Samba
Chapter 2.4: A Basic Samba Configuration File
Chapter 2.5: Starting the Samba Daemons
Chapter 2.6: Testing the Samba Daemons
Chapter 3: Configuring Windows Clients
Chapter 3.1: Setting Up Windows 95/98 Computers
Chapter 3.2: Setting Up Windows NT 4.0 Computers
Chapter 3.3: An Introduction to SMB/CIFS
Chapter 4: Disk Shares
Chapter 4.1: Learning the Samba Configuration File
Chapter 4.2: Special Sections
Chapter 4.3: Configuration File Options
Chapter 4.4: Server Configuration
Chapter 4.5: Disk Share Configuration
Chapter 4.6: Networking Options with Samba
Chapter 4.7: Virtual Servers
Chapter 4.8: Logging Configuration Options
Chapter 5: Browsing and Advanced Disk Shares
Chapter 5.1: Browsing
Chapter 5.2: Filesystem Differences
Chapter 5.3: File Permissions and Attributes on MS-DOS and Unix
Chapter 5.4: Name Mangling and Case
Chapter 5.5: Locks and Oplocks
Chapter 6: Users, Security, and Domains
Chapter 6.1: Users and Groups
Chapter 6.2: Controlling Access to Shares
Chapter 6.3: Authentication Security
Chapter 6.4: Passwords
Chapter 6.5: Windows Domains
Chapter 6.6: Logon Scripts
Chapter 7: Printing and Name Resolution
Chapter 7.1: Sending Print Jobs to Samba
Chapter 7.2: Printing to Windows Client Printers
Chapter 7.3: Name Resolution with Samba
Chapter 8: Additional Samba Information
Chapter 8.1: Supporting Programmers
Chapter 8.2: Magic Scripts
Chapter 8.3: Internationalization
Chapter 8.4: WinPopup Messages
Chapter 8.5: Recently Added Options
Chapter 8.6: Miscellaneous Options
Chapter 8.7: Backups with smbtar
Chapter 9: Troubleshooting Samba
Chapter 9.1: The Tool Bag
Chapter 9.2: The Fault Tree
Chapter 9.3: Extra Resources
Appendix A: Configuring Samba with SSL
Appendix A.1: About Certificates
Appendix A.2: Requirements
Appendix A.3: Installing SSLeay
Appendix A.4: Setting Up SSL Proxy
Appendix A.5: SSL Configuration Options
Appendix B: Samba Performance Tuning
Appendix B.1: A Simple Benchmark
Appendix B.2: Samba Tuning
Appendix B.3: Sizing Samba Servers
Appendix C: Samba Configuration Option Quick Reference

Appendix D: Summary of Samba Daemons and Commands

Appendix E: Downloading Samba with CVS

Appendix F: Sample Configuration File

Index


O'Reilly Home | O'Reilly Bookstores | How to Order | O'Reilly Contacts
International | About O'Reilly | Affiliated Companies

© 1999, O'Reilly & Associates, Inc.

#n199'>199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
/*
	drivers/net/tulip/pnic2.c

	Maintained by Valerie Henson <val_henson@linux.intel.com>
	Copyright 2000,2001  The Linux Kernel Team
	Written/copyright 1994-2001 by Donald Becker.
        Modified to hep support PNIC_II by Kevin B. Hendricks

	This software may be used and distributed according to the terms
	of the GNU General Public License, incorporated herein by reference.

	Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html}
	for more information on this driver, or visit the project
	Web page at http://sourceforge.net/projects/tulip/

*/


/* Understanding the PNIC_II - everything is this file is based
 * on the PNIC_II_PDF datasheet which is sorely lacking in detail
 *
 * As I understand things, here are the registers and bits that
 * explain the masks and constants used in this file that are
 * either different from the 21142/3 or important for basic operation.
 *
 *
 * CSR 6  (mask = 0xfe3bd1fd of bits not to change)
 * -----
 * Bit 24    - SCR
 * Bit 23    - PCS
 * Bit 22    - TTM (Trasmit Threshold Mode)
 * Bit 18    - Port Select
 * Bit 13    - Start - 1, Stop - 0 Transmissions
 * Bit 11:10 - Loop Back Operation Mode
 * Bit 9     - Full Duplex mode (Advertise 10BaseT-FD is CSR14<7> is set)
 * Bit 1     - Start - 1, Stop - 0 Receive
 *
 *
 * CSR 14  (mask = 0xfff0ee39 of bits not to change)
 * ------
 * Bit 19    - PAUSE-Pause
 * Bit 18    - Advertise T4
 * Bit 17    - Advertise 100baseTx-FD
 * Bit 16    - Advertise 100baseTx-HD
 * Bit 12    - LTE - Link Test Enable
 * Bit 7     - ANE - Auto Negotiate Enable
 * Bit 6     - HDE - Advertise 10baseT-HD
 * Bit 2     - Reset to Power down - kept as 1 for normal operation
 * Bit 1     -  Loop Back enable for 10baseT MCC
 *
 *
 * CSR 12
 * ------
 * Bit 25    - Partner can do T4
 * Bit 24    - Partner can do 100baseTx-FD
 * Bit 23    - Partner can do 100baseTx-HD
 * Bit 22    - Partner can do 10baseT-FD
 * Bit 21    - Partner can do 10baseT-HD
 * Bit 15    - LPN is 1 if all above bits are valid other wise 0
 * Bit 14:12 - autonegotiation state (write 001 to start autonegotiate)
 * Bit 3     - Autopolarity state
 * Bit 2     - LS10B - link state of 10baseT 0 - good, 1 - failed
 * Bit 1     - LS100B - link state of 100baseT 0 - good, 1- faild
 *
 *
 * Data Port Selection Info
 *-------------------------
 *
 * CSR14<7>   CSR6<18>    CSR6<22>    CSR6<23>    CSR6<24>   MODE/PORT
 *   1           0           0 (X)       0 (X)       1        NWAY
 *   0           0           1           0 (X)       0        10baseT
 *   0           1           0           1           1 (X)    100baseT
 *
 *
 */



#include "tulip.h"
#include <linux/delay.h>


void pnic2_timer(unsigned long data)
{
	struct net_device *dev = (struct net_device *)data;
	struct tulip_private *tp = netdev_priv(dev);
	void __iomem *ioaddr = tp->base_addr;
	int next_tick = 60*HZ;

	if (tulip_debug > 3)
		printk(KERN_INFO"%s: PNIC2 negotiation status %8.8x.\n",
                    dev->name,ioread32(ioaddr + CSR12));

	if (next_tick) {
		mod_timer(&tp->timer, RUN_AT(next_tick));
	}
}


void pnic2_start_nway(struct net_device *dev)
{
	struct tulip_private *tp = netdev_priv(dev);
	void __iomem *ioaddr = tp->base_addr;
        int csr14;
        int csr12;

        /* set up what to advertise during the negotiation */

        /* load in csr14  and mask off bits not to touch
         * comment at top of file explains mask value
         */
	csr14 = (ioread32(ioaddr + CSR14) & 0xfff0ee39);

        /* bit 17 - advetise 100baseTx-FD */
        if (tp->sym_advertise & 0x0100) csr14 |= 0x00020000;

        /* bit 16 - advertise 100baseTx-HD */
        if (tp->sym_advertise & 0x0080) csr14 |= 0x00010000;

        /* bit 6 - advertise 10baseT-HD */
        if (tp->sym_advertise & 0x0020) csr14 |= 0x00000040;

        /* Now set bit 12 Link Test Enable, Bit 7 Autonegotiation Enable
         * and bit 0 Don't PowerDown 10baseT
         */
        csr14 |= 0x00001184;

	if (tulip_debug > 1)
		printk(KERN_DEBUG "%s: Restarting PNIC2 autonegotiation, "
                      "csr14=%8.8x.\n", dev->name, csr14);

        /* tell pnic2_lnk_change we are doing an nway negotiation */
	dev->if_port = 0;
	tp->nway = tp->mediasense = 1;
	tp->nwayset = tp->lpar = 0;

        /* now we have to set up csr6 for NWAY state */

	tp->csr6 = ioread32(ioaddr + CSR6);
	if (tulip_debug > 1)
		printk(KERN_DEBUG "%s: On Entry to Nway, "
                      "csr6=%8.8x.\n", dev->name, tp->csr6);

        /* mask off any bits not to touch
         * comment at top of file explains mask value
         */
	tp->csr6 = tp->csr6 & 0xfe3bd1fd;

        /* don't forget that bit 9 is also used for advertising */
        /* advertise 10baseT-FD for the negotiation (bit 9) */
        if (tp->sym_advertise & 0x0040) tp->csr6 |= 0x00000200;

        /* set bit 24 for nway negotiation mode ...
         * see Data Port Selection comment at top of file
         * and "Stop" - reset both Transmit (bit 13) and Receive (bit 1)
         */
        tp->csr6 |= 0x01000000;
	iowrite32(csr14, ioaddr + CSR14);
	iowrite32(tp->csr6, ioaddr + CSR6);
        udelay(100);

        /* all set up so now force the negotiation to begin */

        /* read in current values and mask off all but the
	 * Autonegotiation bits 14:12.  Writing a 001 to those bits
         * should start the autonegotiation
         */
        csr12 = (ioread32(ioaddr + CSR12) & 0xffff8fff);
        csr12 |= 0x1000;